In our codebase we explicitly verify completion of side-effect tasks using assertTrue(sideEffectTask.isDone()). One of our tests runs a Task where there are 2 parallel tasks running (let's call them task A and B) such that taskA succeeds and has a sideEffect S attached to it while Task B fails.
In this case, even though B failed, A and S are expected to complete but in our tests the assertion for completion of S sometimes fails.
I was able to replicate this by writing the following quick test in ParseqUnitTestHelperTest class and I see that the reason for this is that runAndWaitException uses runAndWait rather than runAndWaitForPlanToComplete which waits for side-effect tasks to complete.
The fix for this would be to either use runAndWaitForPlanToComplete instead of runAndWait in runAndWaitException (verified that it works) or provide a new runAndWaitForPlanToCompleteException which uses runAndWaitForPlanToComplete underneath but operates like runAndWaitException
I can fix this myself but just want to confirm which one does the parseq team prefer.
In our codebase we explicitly verify completion of side-effect tasks using
assertTrue(sideEffectTask.isDone())
. One of our tests runs a Task where there are 2 parallel tasks running (let's call them task A and B) such that taskA succeeds and has a sideEffect S attached to it while Task B fails. In this case, even though B failed, A and S are expected to complete but in our tests the assertion for completion of S sometimes fails. I was able to replicate this by writing the following quick test inParseqUnitTestHelperTest
class and I see that the reason for this is thatrunAndWaitException
usesrunAndWait
rather thanrunAndWaitForPlanToComplete
which waits for side-effect tasks to complete.The fix for this would be to either use
runAndWaitForPlanToComplete
instead ofrunAndWait
inrunAndWaitException
(verified that it works) or provide a newrunAndWaitForPlanToCompleteException
which usesrunAndWaitForPlanToComplete
underneath but operates likerunAndWaitException
I can fix this myself but just want to confirm which one does the parseq team prefer.