From b2b5e69f7c4835dc8403afa921f2c3530a131c37 Mon Sep 17 00:00:00 2001 From: Chris Constable Date: Fri, 3 Jul 2026 14:18:38 -0400 Subject: [PATCH 1/2] fix flakey WorkflowUpdateTest.duplicateRejectedUpdate logic where ADMITTED was reported for updates that were actually COMPLETED. --- .../testservice/TestWorkflowMutableStateImpl.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/temporal-test-server/src/main/java/io/temporal/internal/testservice/TestWorkflowMutableStateImpl.java b/temporal-test-server/src/main/java/io/temporal/internal/testservice/TestWorkflowMutableStateImpl.java index b99753b96..cb3665c9a 100644 --- a/temporal-test-server/src/main/java/io/temporal/internal/testservice/TestWorkflowMutableStateImpl.java +++ b/temporal-test-server/src/main/java/io/temporal/internal/testservice/TestWorkflowMutableStateImpl.java @@ -3172,13 +3172,18 @@ public UpdateWorkflowExecutionLifecycleStage waitForStage( } public UpdateWorkflowExecutionLifecycleStage getStage() { - if (!accepted.isDone()) { - return UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_ADMITTED; - } else if (!outcome.isDone()) { + // A resolved outcome is terminal (a success result or a rejection/failure), so it always + // means + // COMPLETED. Checking it first keeps stage derivation independent of the order in which the + // `accepted` and `outcome` futures complete. The `accepted` future only distinguishes + // ADMITTED + // from ACCEPTED. + if (outcome.isDone()) { + return UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_COMPLETED; + } else if (accepted.isDone()) { return UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_ACCEPTED; } - return UpdateWorkflowExecutionLifecycleStage - .UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_COMPLETED; + return UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_ADMITTED; } public String getId() { From 873ba8b3edccccc981757d3567f254c4c37d5450 Mon Sep 17 00:00:00 2001 From: Chris Constable Date: Fri, 3 Jul 2026 15:10:57 -0400 Subject: [PATCH 2/2] fix rouge comment formatting --- .../testservice/TestWorkflowMutableStateImpl.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/temporal-test-server/src/main/java/io/temporal/internal/testservice/TestWorkflowMutableStateImpl.java b/temporal-test-server/src/main/java/io/temporal/internal/testservice/TestWorkflowMutableStateImpl.java index cb3665c9a..19c7376ee 100644 --- a/temporal-test-server/src/main/java/io/temporal/internal/testservice/TestWorkflowMutableStateImpl.java +++ b/temporal-test-server/src/main/java/io/temporal/internal/testservice/TestWorkflowMutableStateImpl.java @@ -3173,11 +3173,9 @@ public UpdateWorkflowExecutionLifecycleStage waitForStage( public UpdateWorkflowExecutionLifecycleStage getStage() { // A resolved outcome is terminal (a success result or a rejection/failure), so it always - // means - // COMPLETED. Checking it first keeps stage derivation independent of the order in which the - // `accepted` and `outcome` futures complete. The `accepted` future only distinguishes - // ADMITTED - // from ACCEPTED. + // means COMPLETED. Checking it first keeps stage derivation independent of the order in + // which the `accepted` and `outcome` futures complete. The `accepted` future only + // distinguishes ADMITTED from ACCEPTED. if (outcome.isDone()) { return UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_COMPLETED; } else if (accepted.isDone()) {