Merge pull request #14591 from ZoeShaw101/dev

Tests: Check Watch response error not nil to avoid runtime panic.
This commit is contained in:
Benjamin Wang 2022-10-16 17:00:18 +08:00 committed by GitHub
commit bf6a1d7264
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -340,6 +340,9 @@ func putAndWatch(t *testing.T, wctx *watchctx, key, val string) {
if !ok {
t.Fatalf("unexpected watch close")
}
if err := v.Err(); err != nil {
t.Fatalf("unexpected watch response error: %v", err)
}
if string(v.Events[0].Kv.Value) != val {
t.Fatalf("bad value got %v, wanted %v", v.Events[0].Kv.Value, val)
}