mirror of
https://github.com/coder/coder.git
synced 2025-03-14 10:09:57 +00:00
- (breaking) Protects Logger and LogBodies fields of codersdk.Client with its mutex. This addresses a data race in cli/scaletest. - Fillets the existing cli/createworkspaces unit test and moves the testing logic there into the tests under scaletest/createworkspaces. - Adds testutil.RaceEnabled bool const and conditionaly skips previously-skipped tests under scaletest/ if the race detector is enabled. This is unfortunate and sad, but I would prefer to have these tests at least running without the race detector than not running at all. - Adds IgnoreErrors option to fake in-memory agent loggers; having the agents fail the test immediately when they encounter any sort of error isn't really helpful.
11 lines
340 B
Go
11 lines
340 B
Go
package testutil
|
|
|
|
// RaceEnabled returns whether the race detector is enabled.
|
|
// This is a constant at compile time. It should be used to
|
|
// conditionally skip tests that are known to be sensitive to
|
|
// being run with the race detector enabled.
|
|
// Please use sparingly and as a last resort.
|
|
func RaceEnabled() bool {
|
|
return raceEnabled
|
|
}
|