Skip to content

Commit

Permalink
*: fix TestWatcher (#8812)
Browse files Browse the repository at this point in the history
close #8549

Signed-off-by: Ryan Leung <[email protected]>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
  • Loading branch information
rleungx and ti-chi-bot[bot] authored Nov 18, 2024
1 parent b6826c2 commit 40fe83e
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 40fe83e

Please sign in to comment.