Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: fix race condition in daemon_test
This patch stabilizes newly added TestRunWithLabelRefresh and TestRunWithoutLabelRefresh by using waitForStarted to ensure that first load of HostInfo has happened before new is changed. And especially it adds a little wait to `WaitForCalled` to solve a race condition where a test code might check new HostInfo when it was not yet replaced with the newly loaded one. This also fixes `TestReloadOnCertChange` test which has also failed when the suite was run 1000 times. With this code, `go test --failfast --count 1000 ./daemon/` was successful on my test vm. Signed-off-by: Petr Vobornik <[email protected]>
- Loading branch information