Skip to content

Commit 28aa200

Browse files
authored
Merge pull request #18 from digitalocean/mdl-ovsdb-cleanup
ovsdb: check for callback leaks in testClient
2 parents ab2d506 + b7104ad commit 28aa200

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)