Skip to content

Commit

Permalink
fix TestWatcher
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <[email protected]>
  • Loading branch information
rleungx committed Nov 14, 2024
1 parent 40ae26c commit 967a861
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/encryption/key_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand All @@ -357,6 +356,8 @@ func TestWatcher(t *testing.T) {
},
},
}
// wait watch to start
time.Sleep(time.Second)
err = saveKeys(leadership, masterKeyMeta, keys, defaultKeyManagerHelper())
re.NoError(err)
<-reloadEvent
Expand Down

0 comments on commit 967a861

Please sign in to comment.