-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
servstate: remove test races on svcs file output
Unit Tests for servstate is extremely timing sensitive. If you run the unit tests under heavy CPU load, changes are very good you will start to see various failures. The easiest way to demonstrate this is to use the stress utility to simulate heavy CPU load (stress --io 12 --cpu 12). Unit Test output snippet: START: manager_test.go:828: S.TestEnvironment ... obtained string = "" ... expected string = "" + ... "PEBBLE_ENV_TEST_1=foo\n" + ... "PEBBLE_ENV_TEST_2=bar bazz\n" + ... "PEBBLE_ENV_TEST_PARENT=from-parent\n" FAIL: manager_test.go:828: S.TestEnvironment This specific race condition is caused because unit tests often make assumptions on how long it takes from the moment the service is started until the moment the service command completes. This PR will only address this very specific kind of race, and hopefully in the process provide a solution that will be used in future tests. Please note that using the stress utility on tests from this package will still trigger lots of remaining races caused by very timing sensitive tests.
- Loading branch information
Showing
1 changed file
with
93 additions
and
81 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