Skip to content

Commit 4b1f1db

Browse files
committed
Paper over possible server bug
1 parent f3b9b73 commit 4b1f1db

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/test/src/test-integration-workflows-with-recorded-logs.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,15 @@ export async function runUnfinishedHandlersWorkflowTerminationTypeWorkflow(
207207
handlerMayReturn = true;
208208
await workflow.condition(workflow.allHandlersFinished);
209209
}
210-
await workflow.continueAsNew('return');
210+
// If we do not pass waitAllHandlersFinished here then the test occasionally fails. Recall
211+
// that this test causes the worker to send a WFT response containing commands
212+
// [completeUpdate, CAN]. Usually, that results in the update completing, the caller getting
213+
// the update result, and the workflow CANing. However occasionally (~1/30) there is a server
214+
// level=ERROR msg="service failures" operation=UpdateWorkflowExecution wf-namespace=default error="unable to locate current workflow execution"
215+
// the update caller does not get a response, and the update is included again in the first
216+
// WFT sent to the post-CAN workflow run. (This causes the current test to fail unless the
217+
// post-CAN run waits for handlers to finish).
218+
await workflow.continueAsNew('return', waitAllHandlersFinished);
211219
throw new Error('unreachable');
212220
case 'failure':
213221
throw new workflow.ApplicationFailure('Deliberately failing workflow with an unfinished handler');

0 commit comments

Comments
 (0)