Open
Description
The some tests have the following expectation, or equivalent:
try #require(sync.wait(timeout: .now() + .seconds(2)) == .success)
This test is prone to flaky behaviour as the 2-second "timer" may or may not be sufficient.
We should update these affected tests to have a more deterministic assertion that does not rely on "timing" or any other behaviour that may cause a flaky tests.
Some suggestions:
- Perhaps Removing the timeout value all-together altogether and specifying a test-level timeout
- Getting away from that synchronous
.wait
call, and instead using something asynchronous
At the time of writing, the tests were:
BasicsTests.ConcurrencyHelpersTest/threadSafeArrayStore()
BasicsTests.ConcurrencyHelpersTest/threadSafeBox()
BasicsTests.ConcurrencyHelpersTest/threadSafeKeyValueStore()
CommandsTests.RunCommandTests/swiftRunSIGINT(buildSystem:)