forked from openservicemesh/osm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests(debug server): fix race condition (openservicemesh#2017)
Currently, the tests that dynamically start/stop the debug HTTP server rely on a `sync.WaitGroup` that signals when a mocked debug server has been started or stopped. `TestConfigureDebugServerErr` was failing occasionally because `configureDebugServer` wasn't guaranteed to finish stopping the server before the test's `sync.WaitGroup` signalled it was done. This change removes the `sync.WaitGroup` from the tests and instead adds a new channel parameter to `configureDebugServer` that will emit errors (or nil if successful) whenever the server is started or stopped. Then, the tests can be sure that `configureDebugServer` has finished before checking any values.
- Loading branch information
Showing
2 changed files
with
40 additions
and
28 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
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