At least this test (there's probably more) is a flaky. We need to ensure that it fails/succeeds consistently 99.99% of the time.
test_async_concurrency
One solution I can think of now is to just use a much bigger number of tasks and a bigger error margin. Even though the error margin is bigger, a much bigger of tasks would make up for it and make the error margin negligible.
- results_actual = await asyncio.gather(*[simple_app.wait.apply_async(t_s=1) for _ in range(5)])
+ results_actual = await asyncio.gather(*[simple_app.wait.apply_async(t_s=1) for _ in range(20)])
- error = 0.1
+ error = 0.5
assert 1.0 < dt_actual < 1.0 + error
# And the results should be correct
results_expected = [1] * 20
assert results_actual == results_expected
At least this test (there's probably more) is a flaky. We need to ensure that it fails/succeeds consistently 99.99% of the time.
One solution I can think of now is to just use a much bigger number of tasks and a bigger error margin. Even though the error margin is bigger, a much bigger of tasks would make up for it and make the error margin negligible.