vendor: Update github.com/syndtr/goleveldb

This commit is contained in:
Jakob Borg
2016-12-28 12:19:14 +01:00
parent c69c3c7c36
commit eb14f85a57
43 changed files with 1005 additions and 669 deletions

View File

@@ -1877,7 +1877,7 @@ func TestDB_ConcurrentIterator(t *testing.T) {
}
func TestDB_ConcurrentWrite(t *testing.T) {
const n, niter = 10, 10000
const n, bk, niter = 10, 3, 10000
h := newDbHarness(t)
defer h.close()
@@ -1889,7 +1889,7 @@ func TestDB_ConcurrentWrite(t *testing.T) {
go func(i int) {
defer wg.Done()
for k := 0; k < niter; k++ {
kstr := fmt.Sprintf("%d.%d", i, k)
kstr := fmt.Sprintf("put-%d.%d", i, k)
vstr := fmt.Sprintf("v%d", k)
h.put(kstr, vstr)
// Key should immediately available after put returns.
@@ -1897,6 +1897,24 @@ func TestDB_ConcurrentWrite(t *testing.T) {
}
}(i)
}
for i := 0; i < n; i++ {
wg.Add(1)
batch := &Batch{}
go func(i int) {
defer wg.Done()
for k := 0; k < niter; k++ {
batch.Reset()
for j := 0; j < bk; j++ {
batch.Put([]byte(fmt.Sprintf("batch-%d.%d.%d", i, k, j)), []byte(fmt.Sprintf("v%d", k)))
}
h.write(batch)
// Key should immediately available after put returns.
for j := 0; j < bk; j++ {
h.getVal(fmt.Sprintf("batch-%d.%d.%d", i, k, j), fmt.Sprintf("v%d", k))
}
}
}(i)
}
wg.Wait()
}