diff --git a/pkg/encryption/key_manager_test.go b/pkg/encryption/key_manager_test.go index e827a714a3a..e541e287677 100644 --- a/pkg/encryption/key_manager_test.go +++ b/pkg/encryption/key_manager_test.go @@ -329,8 +329,7 @@ func TestWatcher(t *testing.T) { // Listen on watcher event reloadEvent := make(chan struct{}, 10) helper.eventAfterReloadByWatcher = func() { - var e struct{} - reloadEvent <- e + reloadEvent <- struct{}{} } // Use default config. config := &Config{} @@ -357,6 +356,7 @@ func TestWatcher(t *testing.T) { }, }, } + re.NoError(m.loadKeys()) err = saveKeys(leadership, masterKeyMeta, keys, defaultKeyManagerHelper()) re.NoError(err) <-reloadEvent