Skip to content

Commit e89fd19

Browse files
authored
Fix test TestProcessWorkflowRunTimeout_Pending (temporalio#7181)
## What changed? <!-- Describe what has changed in this PR --> Fix test TestProcessWorkflowRunTimeout_Pending. ## Why? <!-- Tell your future self why have you made these changes --> This test was flaky, and relying on the test suite `now` variable to be very close to the mutable state start time. If the difference is less than 1ms, I think the test passes. ## How did you test it? <!-- How have you verified this change? Tested locally? Added a unit test? Checked in staging env? --> ## Potential risks <!-- Assuming the worst case, what can be broken when deploying this change to production? --> ## Documentation <!-- Have you made sure this change doesn't falsify anything currently stated in `docs/`? If significant new behavior is added, have you described that in `docs/`? --> ## Is hotfix candidate? <!-- Is this PR a hotfix candidate or does it require a notification to be sent to the broader community? (Yes/No) -->
1 parent a5b5b9f commit e89fd19

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

service/history/timer_queue_standby_task_executor_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,7 @@ func (s *timerQueueStandbyTaskExecutorSuite) TestProcessWorkflowRunTimeout_Pendi
10541054
// Flush buffered events so real IDs get assigned
10551055
mutableState.FlushBufferedEvents()
10561056

1057+
startTime := mutableState.GetExecutionState().GetStartTime().AsTime()
10571058
timerTask := &tasks.WorkflowRunTimeoutTask{
10581059
WorkflowKey: definition.NewWorkflowKey(
10591060
s.namespaceID.String(),
@@ -1062,7 +1063,7 @@ func (s *timerQueueStandbyTaskExecutorSuite) TestProcessWorkflowRunTimeout_Pendi
10621063
),
10631064
Version: s.version,
10641065
TaskID: s.mustGenerateTaskID(),
1065-
VisibilityTimestamp: s.now.Add(workflowRunTimeout),
1066+
VisibilityTimestamp: startTime.Add(workflowRunTimeout),
10661067
}
10671068

10681069
persistenceMutableState := s.createPersistenceMutableState(mutableState, completionEvent.GetEventId(), completionEvent.GetVersion())

0 commit comments

Comments
 (0)