Skip to content

Commit db05355

Browse files
committed
Paper over possible server bug
1 parent 26e7b27 commit db05355

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

0 commit comments

Comments
 (0)