cluster: 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:05:08 +08:00
parent c70e39cd21
commit 100839fcea
No known key found for this signature in database
GPG Key ID: DAEBBD2E34C111E6

View File

@ -44,7 +44,7 @@ func TestEtcdElector(t *testing.T) {
etcdCfg, cleanup, err := etcd.NewEmbeddedEtcdInstance(tmpDir, 0, 0, "") etcdCfg, cleanup, err := etcd.NewEmbeddedEtcdInstance(tmpDir, 0, 0, "")
require.NoError(t, err) require.NoError(t, err)
defer cleanup() t.Cleanup(cleanup)
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
defer cancel() defer cancel()