Fixed flaky test TerminatedWorkflowTest.testShouldReturnQueryResultAfterWorkflowTimeout - #3116
maciejdudko wants to merge 2 commits into
Conversation
| workflow.start(); | ||
|
|
||
| WorkflowExecution execution = workflow.getExecution(); | ||
| if (testWorkflowRule |
There was a problem hiding this comment.
This condition is going to check shortly after starting the workflow and possibly not give the task to the worker on the first few iterations. Should we wait for the workflow to close via timeout before checking there is a WFT started?
There was a problem hiding this comment.
I thought streamHistory is going to keep waiting for more events. Apparently not. Going to replace it with direct streaming history after execution timeout.GetWorkflowExecutionHistory RPC call
The previous (flaky) version waited for the timeout, but sometimes the server reached the timeout before issuing the first task, and then queries didn't work. The idea here is to ensure the workflow task was issued before the timeout, and if not, try again.
8d01244 to
dfed318
Compare
What was changed
Fixed flaky test
TerminatedWorkflowTest.testShouldReturnQueryResultAfterWorkflowTimeout.Why?
It was causing multiple CI failures due to tight timing, e.g. https://github.com/temporalio/sdk-java/actions/runs/36925028394/job/110742314341?pr=3112
Checklist
Closes Flaky testShouldReturnQueryResultAfterWorkflowTimeout #630
How was this tested:
Test passes with both in-memory server and CLI.