-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TestJobQueueSemaphoresFIFO fails occasionally #276
Comments
The spirit of the test is to check that jobs are run in the order they are scheduled. The only relevant error message is the first one, all subsequent ones are knock-ons from the first (they might actually be fine, it's just we can't count them anymore). The crux of the issue here is that this:
The race is here: platform/cmd/fake-batch/semaphore.go Lines 48 to 61 in cf16185
The problem is that multiple A true fix would have to implement another queuing mechanism, which didn't rely on the scheduler for ordering in this manner. The failure rate can be pushed down by 100x with something like this:
However, it doesn't totally fix the problem because a goroutine can be interrupted between the close and the A flaky test sucks. So we should do something about this. However, I don't really consider this a true bug, because if two 'requests to run a job' run close enough that the scheduling delay matters, those events are simultaneous for all intents and purposes, so either order is valid. It would matter if we were providing a semantic like "if you observe the job entered the queue, then you run another job, the jobs will run in order". We currently could theoretically fail that test under high load or rare circumstances. I would consider this a good intermediate exercise to fix some time to get your head around these concurrency issues. There are lots of potential ways of fixing it. |
I've noticed that TestJobQueueSemaphoresFIFO fails sometimes. Running it through stress results in the following:
The text was updated successfully, but these errors were encountered: