Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(test): Fix intermittent timeout in PooledRequestQueueTest (#4777)
I fixed a deadlock in this test a few weeks ago, but just ran into one other timeout. This commit makes a few minor fixes to reduce the chances of hitting a timeout here. First: (1) Use a fixed thread pool executor so we create all the threads we need up front and reduce the work later. (2) Don't start our timeout clock until the job we're expecting to timeout has been queued. (3) Increase the startup timeout to 50 ms and only time out the test after 10x (instead of 5x); this is just so we're dealing with slightly larger absolute numbers. (Before we were only waiting 100 ms to time out the test, now we're waiting 500ms.) (4) Fail with a specific message if we timeout, rather than assert on the status of the job (which we know won't be in the expected state because we killed it). This just helps debugging as I was confused at first what happened. I think this only happens if you are running the clouddriver tests locally with your editor open while on a video call, but hopefully with these fixes the tests pass even in that case.
- Loading branch information