Skip to content

Commit d4305e6

Browse files
bergundyclaude
andcommitted
Fix flaky cancelAsyncOperationAbandon test signal pollution
The ABANDON cancel-before-sent sub-test can start a handler workflow that sets the shared opStarted/handlerFinished signals, causing the subsequent after-start sub-test to proceed with stale signal state and fail. Clear both signals between the two sub-tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 996ba32 commit d4305e6

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

temporal-sdk/src/test/java/io/temporal/workflow/nexus/CancelWorkflowAsyncOperationTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ public void cancelAsyncOperationAbandon() {
135135
// Cancel before command is sent
136136
runCancelBeforeSentTest(NexusOperationCancellationType.ABANDON);
137137

138+
// For ABANDON, the handler workflow may start even in the cancel-before-sent case,
139+
// which can set opStarted and handlerFinished. Clear them before the after-start test.
140+
opStarted.clearSignal();
141+
handlerFinished.clearSignal();
142+
138143
// Cancel after operation is started
139144
WorkflowStub stub =
140145
testWorkflowRule.newUntypedWorkflowStubTimeoutOptions("TestNexusOperationCancellationType");

0 commit comments

Comments
 (0)