Currently, our tests use WaitForCondition with a timeout (or simply no timeout) to test scenarios. No timeout is acceptable for GitHub Actions as a global timeout can be set, though it doesn't help the developer see offending tests easily. Custom timeouts with waiting and timers is not reliable with parallelism enabled (by default in xunit) and we've had several times where we had to increase the timeout for GitHub Actions when it works locally, which is not ideal.
To fix this, we should switch to using xunit built-in timeout. To do so, there are two required steps:
Add the Timeout parameter to a fact/theory [Fact(Timeout = 1000)] sets a timeout of 1.0 seconds.
Before submitting code, ensure this doesn't have too large of an impact on test runtime. While it'd be good to switch to standard timeout system, it may not be worth it if the tests suddenly take several minutes in stead of several seconds. Feel free to discuss here if the tradeoff isn't worth it or if it's unclear.
Acceptance Criteria
[ ] Move from WaitForCondition timeouts to await with an xunit timeout (can be done by instead of tracking a bool in the callbacks, creating and then completing a Task)
[ ] Add timeout to any other tests which may have a risk of timeout but are unguarded. Consider AprsIsConnectionUnitTests.TestDisconnect
Description
Currently, our tests use
WaitForCondition
with a timeout (or simply no timeout) to test scenarios. No timeout is acceptable for GitHub Actions as a global timeout can be set, though it doesn't help the developer see offending tests easily. Custom timeouts with waiting and timers is not reliable with parallelism enabled (by default in xunit) and we've had several times where we had to increase the timeout for GitHub Actions when it works locally, which is not ideal.To fix this, we should switch to using xunit built-in timeout. To do so, there are two required steps:
Timeout
parameter to a fact/theory[Fact(Timeout = 1000)]
sets a timeout of 1.0 seconds.Before submitting code, ensure this doesn't have too large of an impact on test runtime. While it'd be good to switch to standard timeout system, it may not be worth it if the tests suddenly take several minutes in stead of several seconds. Feel free to discuss here if the tradeoff isn't worth it or if it's unclear.
Acceptance Criteria
WaitForCondition
timeouts to await with an xunit timeout (can be done by instead of tracking a bool in the callbacks, creating and then completing aTask
)AprsIsConnectionUnitTests.TestDisconnect