Skip to content

Commit b7104ad

Browse files
committed
ovsdb: check for callback leaks in testClient
1 parent ab2d506 commit b7104ad

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ovsdb/client_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,13 @@ func testClient(t *testing.T, fn jsonrpc.TestFunc) (*ovsdb.Client, chan<- *jsonr
195195
return c, notifC, func() {
196196
_ = c.Close()
197197
done()
198+
199+
// Make sure that the Client cleaned up appropriately.
200+
stats := c.Stats()
201+
202+
if diff := cmp.Diff(0, stats.Callbacks.Current); diff != "" {
203+
t.Fatalf("unexpected final number of callbacks (-want +got):\n%s", diff)
204+
}
198205
}
199206
}
200207

0 commit comments

Comments
 (0)