Skip to content

Commit

Permalink
Fix signal CAN non determinism test (#2084)
Browse files Browse the repository at this point in the history
Fix testSignalContinueAsNewNonDeterminism
  • Loading branch information
Quinn-With-Two-Ns authored May 31, 2024
1 parent 0c8073e commit cde114c
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
import org.junit.Test;

public class SignalContinueAsNewNonDeterminism {
private static final Semaphore workflowTaskProcessed = new Semaphore(1);
private static final Semaphore workflowTaskProcessed = new Semaphore(0);

private static final CompletableFuture<Boolean> continueAsNew = new CompletableFuture<>();

Expand Down Expand Up @@ -78,10 +78,11 @@ public void testSignalContinueAsNewNonDeterminism()

WorkflowClient.start(client::execute, false);
for (int i = 0; i < 5; i++) {
workflowTaskProcessed.acquire();
client.signal();
workflowTaskProcessed.acquire();
}
continueAsNew.complete(true);

// Force replay, expected to fail with NonDeterministicException
testWorkflowRule.invalidateWorkflowCache();
client.signal();
Expand Down

0 comments on commit cde114c

Please sign in to comment.