mirror of
https://github.com/gogrlx/bitcask.git
synced 2026-04-02 02:58:59 -07:00
retain lock file after merge (#201)
* Add test case for Locking after Merge * retain lock file after merge * remove replacing lock file (not needed) Co-authored-by: James Mills <prologic@shortcircuit.net.au> Co-authored-by: yash <yash.chandra@grabpay.com>
This commit is contained in:
committed by
GitHub
parent
6e423ae179
commit
f397bec88f
@@ -1627,6 +1627,27 @@ func TestLocking(t *testing.T) {
|
||||
assert.Error(err)
|
||||
}
|
||||
|
||||
func TestLockingAfterMerge(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
testdir, err := ioutil.TempDir("", "bitcask")
|
||||
assert.NoError(err)
|
||||
|
||||
db, err := Open(testdir)
|
||||
assert.NoError(err)
|
||||
defer db.Close()
|
||||
|
||||
_, err = Open(testdir)
|
||||
assert.Error(err)
|
||||
|
||||
err = db.Merge()
|
||||
assert.NoError(err)
|
||||
|
||||
// This should still error.
|
||||
_, err = Open(testdir)
|
||||
assert.Error(err)
|
||||
}
|
||||
|
||||
type benchmarkTestCase struct {
|
||||
name string
|
||||
size int
|
||||
|
||||
Reference in New Issue
Block a user