mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #4298 from heyitsanthony/fix-testapplysnapshot-race
etcdserver/test: synchronously wait on TestApplySnapshotAndCommittedE…
This commit is contained in:
commit
14255854d8
@ -1019,7 +1019,7 @@ func TestRecvSnapshot(t *testing.T) {
|
||||
// first and then committed entries.
|
||||
func TestApplySnapshotAndCommittedEntries(t *testing.T) {
|
||||
n := newNopReadyNode()
|
||||
st := store.NewRecorder()
|
||||
st := store.NewRecorderStream()
|
||||
cl := newCluster("abc")
|
||||
cl.SetStore(store.New())
|
||||
storage := raft.NewMemoryStorage()
|
||||
|
@ -756,13 +756,17 @@ type StoreRecorder struct {
|
||||
// It always returns invalid empty response and no error.
|
||||
type storeRecorder struct {
|
||||
Store
|
||||
testutil.RecorderBuffered
|
||||
testutil.Recorder
|
||||
}
|
||||
|
||||
func NewNop() Store { return &storeRecorder{} }
|
||||
func NewNop() Store { return &storeRecorder{Recorder: &testutil.RecorderBuffered{}} }
|
||||
func NewRecorder() *StoreRecorder {
|
||||
sr := &storeRecorder{}
|
||||
return &StoreRecorder{Store: sr, Recorder: sr}
|
||||
sr := &storeRecorder{Recorder: &testutil.RecorderBuffered{}}
|
||||
return &StoreRecorder{Store: sr, Recorder: sr.Recorder}
|
||||
}
|
||||
func NewRecorderStream() *StoreRecorder {
|
||||
sr := &storeRecorder{Recorder: testutil.NewRecorderStream()}
|
||||
return &StoreRecorder{Store: sr, Recorder: sr.Recorder}
|
||||
}
|
||||
|
||||
func (s *storeRecorder) Version() int { return 0 }
|
||||
@ -856,7 +860,8 @@ type errStoreRecorder struct {
|
||||
|
||||
func NewErrRecorder(err error) *StoreRecorder {
|
||||
sr := &errStoreRecorder{err: err}
|
||||
return &StoreRecorder{Store: sr, Recorder: sr}
|
||||
sr.Recorder = &testutil.RecorderBuffered{}
|
||||
return &StoreRecorder{Store: sr, Recorder: sr.Recorder}
|
||||
}
|
||||
|
||||
func (s *errStoreRecorder) Get(path string, recursive, sorted bool) (*Event, error) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user