watchtower: replace defer cleanup with t.Cleanup

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
Eng Zer Jun
2022-08-27 15:07:59 +08:00
parent 22cd790586
commit 228f1e36c4
2 changed files with 7 additions and 6 deletions

View File

@ -1528,8 +1528,10 @@ func TestClient(t *testing.T) {
t.Parallel()
h := newHarness(t, tc.cfg)
defer h.server.Stop()
defer h.client.ForceQuit()
t.Cleanup(func() {
require.NoError(t, h.server.Stop())
h.client.ForceQuit()
})
tc.fn(h)
})