mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Rename the test and update comments
Signed-off-by: Jin Dong <greenmoon55@gmail.com>
This commit is contained in:
parent
f2d718e641
commit
4c853774e6
@ -350,9 +350,9 @@ func putAndWatch(t *testing.T, wctx *watchctx, key, val string) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestWatchResumeInitRev tests watch resume with disconnect before the first event.
|
||||
// It ensures that correct events are returned corresponding to the start revision.
|
||||
func TestWatchResumeInitRev(t *testing.T) {
|
||||
// TestWatchResumeAfterDisconnect tests watch resume after member disconnects then connects.
|
||||
// It ensures that correct events are returned corresponding to the start revision.
|
||||
func TestWatchResumeAfterDisconnect(t *testing.T) {
|
||||
integration2.BeforeTest(t)
|
||||
clus := integration2.NewCluster(t, &integration2.ClusterConfig{Size: 1, UseBridge: true})
|
||||
defer clus.Terminate(t)
|
||||
@ -394,13 +394,16 @@ func TestWatchResumeInitRev(t *testing.T) {
|
||||
if !ok {
|
||||
t.Fatal("unexpected watch close")
|
||||
}
|
||||
if len(resp.Events) == 0 {
|
||||
t.Fatal("expected event on watch")
|
||||
}
|
||||
// Events should be put(a, 3) and put(a, 4)
|
||||
if len(resp.Events) != 2 {
|
||||
t.Fatal("expected two events on watch")
|
||||
}
|
||||
if string(resp.Events[0].Kv.Value) != "3" {
|
||||
t.Fatalf("expected value=3, got event %+v", resp.Events[0])
|
||||
}
|
||||
if string(resp.Events[1].Kv.Value) != "4" {
|
||||
t.Fatalf("expected value=4, got event %+v", resp.Events[1])
|
||||
}
|
||||
case <-time.After(5 * time.Second):
|
||||
t.Fatal("watch timed out")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user