Skip to content

Commit

Permalink
Check Watch response error not nil to avoid runtime panic.
Browse files Browse the repository at this point in the history
Fixes issue: #14259

Signed-off-by: Wang Xiaoxiao 1141195807@qq.com
  • Loading branch information
halegreen committed Oct 15, 2022
1 parent 6a0bbf3 commit 11689fd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/integration/clientv3/watch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 11689fd

Please sign in to comment.