-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resource: Fix flaky test due to missing Done call
The workaround in 5fa2ac4 was faulty as it did not call ev.Done on the received event leading to further events not being received and thus eventually causing the context to time out. The problem was reproduced reliably locally by adding short time.Sleep calls to the pushUpdate and the initial listing to trigger the race causing the double updates. To remedy this, add the missing ev.Done call, handle timeout gracefully and make assertions FailNow immediately to not mask problems due to e.g. nil deref. FIxes: #24696 Fixes: 5fa2ac4 ("resource: Work around a rare race in initial sync") Signed-off-by: Jussi Maki <jussi@isovalent.com>
- Loading branch information
1 parent
96685b3
commit e76d40f
Showing
1 changed file
with
46 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters