Backport go_srcs_in_module changes and fix goword failures.

Signed-off-by: James Blair <mail@jamesblair.net>
This commit is contained in:
James Blair
2023-02-24 22:01:41 +13:00
parent 183af509f6
commit 1ea808b5ba
42 changed files with 121 additions and 313 deletions

View File

@@ -27,7 +27,7 @@ import (
"go.uber.org/zap/zaptest"
)
// Test HashByRevValue values to ensure we don't change the output which would
// TestHashByRevValue values to ensure we don't change the output which would
// have catastrophic consequences. Expected output is just hardcoded, so please
// regenerate it every time you change input parameters.
func TestHashByRevValue(t *testing.T) {
@@ -127,6 +127,7 @@ func testHashByRev(t *testing.T, s *store, rev int64) KeyValueHash {
return hash
}
// TestCompactionHash
// TODO: Change this to fuzz test
func TestCompactionHash(t *testing.T) {
b, _ := betesting.NewDefaultTmpBackend(t)

View File

@@ -529,7 +529,7 @@ func cloneGeneration(g *generation) *generation {
return &generation{g.ver, g.created, tmp}
}
// test that compact on version that higher than last modified version works well
// TestKeyIndexCompactOnFurtherRev to test that compact on version that higher than last modified version works well
func TestKeyIndexCompactOnFurtherRev(t *testing.T) {
ki := &keyIndex{key: []byte("foo")}
ki.put(zap.NewExample(), 1, 0)

View File

@@ -360,7 +360,7 @@ func testKVDeleteMultipleTimes(t *testing.T, f deleteRangeFunc) {
}
}
// test that range, put, delete on single key in sequence repeatedly works correctly.
// TestKVOperationInSequence to test that range, put, delete on single key in sequence repeatedly works correctly.
func TestKVOperationInSequence(t *testing.T) {
b, tmpPath := betesting.NewDefaultTmpBackend(t)
s := NewStore(zap.NewExample(), b, &lease.FakeLessor{}, StoreConfig{})
@@ -462,7 +462,7 @@ func TestKVTxnNonBlockRange(t *testing.T) {
}
}
// test that txn range, put, delete on single key in sequence repeatedly works correctly.
// TestKVTxnOperationInSequence to test that txn range, put, delete on single key in sequence repeatedly works correctly.
func TestKVTxnOperationInSequence(t *testing.T) {
b, tmpPath := betesting.NewDefaultTmpBackend(t)
s := NewStore(zap.NewExample(), b, &lease.FakeLessor{}, StoreConfig{})

View File

@@ -94,7 +94,7 @@ func BenchmarkConsistentIndex(b *testing.B) {
}
}
// BenchmarkStoreTxnPutUpdate is same as above, but instead updates single key
// BenchmarkStorePutUpdate is same as above, but instead updates single key
func BenchmarkStorePutUpdate(b *testing.B) {
be, tmpPath := betesting.NewDefaultTmpBackend(b)
s := NewStore(zap.NewExample(), be, &lease.FakeLessor{}, StoreConfig{})

View File

@@ -113,9 +113,9 @@ func benchmarkWatchableStoreWatchPut(b *testing.B, synced bool) {
}
}
// Benchmarks on cancel function performance for unsynced watchers
// in a WatchableStore. It creates k*N watchers to populate unsynced
// with a reasonably large number of watchers. And measures the time it
// BenchmarkWatchableStoreUnsyncedCancel to benchmark on cancel function performance
// for unsynced watchers in a WatchableStore. It creates k*N watchers to populate
// unsynced with a reasonably large number of watchers. And measures the time it
// takes to cancel N watchers out of k*N watchers. The performance is
// expected to differ depending on the unsynced member implementation.
// TODO: k is an arbitrary constant. We need to figure out what factor