From 100839fcead6d6886312b6b85dcb3a227b36dd78 Mon Sep 17 00:00:00 2001 From: Eng Zer Jun Date: Sat, 27 Aug 2022 15:05:08 +0800 Subject: [PATCH] cluster: replace defer cleanup with `t.Cleanup` Signed-off-by: Eng Zer Jun --- cluster/etcd_elector_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster/etcd_elector_test.go b/cluster/etcd_elector_test.go index 59cd25606..999a3d791 100644 --- a/cluster/etcd_elector_test.go +++ b/cluster/etcd_elector_test.go @@ -44,7 +44,7 @@ func TestEtcdElector(t *testing.T) { etcdCfg, cleanup, err := etcd.NewEmbeddedEtcdInstance(tmpDir, 0, 0, "") require.NoError(t, err) - defer cleanup() + t.Cleanup(cleanup) ctx, cancel := context.WithCancel(context.Background()) defer cancel()