mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
mvcc: test inflight Hash to trigger Size on nil db
This commit is contained in:
parent
7d30326968
commit
994e8e4f40
@ -532,6 +532,20 @@ func newTestKeyBytes(rev revision, tombstone bool) []byte {
|
||||
return bytes
|
||||
}
|
||||
|
||||
// TestStoreHashAfterForceCommit ensures that later Hash call to
|
||||
// closed backend with ForceCommit does not panic.
|
||||
func TestStoreHashAfterForceCommit(t *testing.T) {
|
||||
be, tmpPath := backend.NewDefaultTmpBackend()
|
||||
kv := NewStore(be, &lease.FakeLessor{}, nil)
|
||||
defer os.Remove(tmpPath)
|
||||
|
||||
// as in EtcdServer.HardStop
|
||||
kv.Close()
|
||||
be.Close()
|
||||
|
||||
kv.Hash()
|
||||
}
|
||||
|
||||
func newFakeStore() *store {
|
||||
b := &fakeBackend{&fakeBatchTx{
|
||||
Recorder: &testutil.RecorderBuffered{},
|
||||
|
Loading…
x
Reference in New Issue
Block a user