-
Notifications
You must be signed in to change notification settings - Fork 15
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
Flaky test: ProcessEventInspectionsTest.testFindLastProcessInstance #202
Comments
It seems the issue is not fully fixed by #218. A second theory on why this could go wrong:
We don't wait for the engine to have reached an idle state between step 3 and 4. Could it be that the engine time is increased before the timer is created, giving the timer a different due date than expected? The logs should show this. The records show:
The workflow ended at: So this theory does not seem likely. The day difference makes sense, since we tell the engine to increase the time by a day. |
@pihme I know you love flaky tests 🙃 Do you have any other idea on why this could go wrong? |
Not really, no. I am wondering whether our approach is flawed. It seems our approach rests on records, but advancing the time produces no records by itself and the timing of when time increase has an effect is not deterministic. One other approach could be:
If this works better, we could also think about offering an interface like:
Then in that method, we could check the current time, the timeout of the timer, increase the time by the delta, wait for that timer to get triggered, then return. This would also be a more convenient interface for users, because then they don't need to calculate the amount by which the time should be increased. |
I tried your proposed solution a few times using This kinda worried me, because that would mean the timer would not have been triggered within 10 seconds. I'm starting to wonder if this could be a Zeebe thing, where it just takes a while before timers are triggered after the actor scheduler time has been increased. Another thing that bothers me is that it's always this test, even though we have plenty of tests where we increase the time. |
Description
It seems to be a timing issue. This process contains a timer and the test increases the time of the engine:
Utilities.increaseTime(engine, Duration.ofDays(1));
. Possibly the engine has not yet triggered the timer and started processing before we checked if it's idle. This means we consider the engine to be idle, even though it still has stuff to do (triggering the timer).Occurs with both extensions.
The text was updated successfully, but these errors were encountered: