e2e: don't Put() after watchTest finishes

Fixes #5598
release-3.0
Anthony Romano 2016-06-13 16:44:05 -07:00
parent 70a2add2b0
commit d78ef8bc72
1 changed files with 4 additions and 1 deletions

View File

@ -61,25 +61,28 @@ func watchTest(cx ctlCtx) {
[]kv{{"etcd", "revision_2"}, {"etcd", "revision_3"}},
},
{ // watch 3 keys by range
[]kv{{"key1", "val1"}, {"key2", "val2"}, {"key3", "val3"}},
[]kv{{"key1", "val1"}, {"key3", "val3"}, {"key2", "val2"}},
[]string{"key", "key3", "--rev", "1"},
[]kv{{"key1", "val1"}, {"key2", "val2"}},
},
}
for i, tt := range tests {
donec := make(chan struct{})
go func(i int, puts []kv) {
for j := range puts {
if err := ctlV3Put(cx, puts[j].key, puts[j].val, ""); err != nil {
cx.t.Fatalf("watchTest #%d-%d: ctlV3Put error (%v)", i, j, err)
}
}
close(donec)
}(i, tt.puts)
if err := ctlV3Watch(cx, tt.args, tt.wkv...); err != nil {
if cx.dialTimeout > 0 && !isGRPCTimedout(err) {
cx.t.Errorf("watchTest #%d: ctlV3Watch error (%v)", i, err)
}
}
<-donec
}
}