Skip to content

Commit c886a7e

Browse files
committed
Fix regression from #3489 merge
1 parent 41e1a38 commit c886a7e

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

host/activity_test.go

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -737,10 +737,9 @@ func (s *integrationSuite) TestActivityTimeouts() {
737737
StartToCloseTimeout: timestamp.DurationPtr(5 * time.Second), // ActivityID C is expected to timeout using StartToClose
738738
HeartbeatTimeout: timestamp.DurationPtr(0 * time.Second),
739739
RetryPolicy: &commonpb.RetryPolicy{
740-
InitialInterval: timestamp.DurationPtr(1 * time.Second),
741-
MaximumInterval: timestamp.DurationPtr(1 * time.Second),
742-
BackoffCoefficient: 1,
743-
}},
740+
MaximumAttempts: 1, // Disable retry and let it timeout.
741+
},
742+
},
744743
}}, {
745744
CommandType: enumspb.COMMAND_TYPE_SCHEDULE_ACTIVITY_TASK,
746745
Attributes: &commandpb.Command_ScheduleActivityTaskCommandAttributes{ScheduleActivityTaskCommandAttributes: &commandpb.ScheduleActivityTaskCommandAttributes{
@@ -752,6 +751,9 @@ func (s *integrationSuite) TestActivityTimeouts() {
752751
ScheduleToStartTimeout: timestamp.DurationPtr(20 * time.Second),
753752
StartToCloseTimeout: timestamp.DurationPtr(15 * time.Second),
754753
HeartbeatTimeout: timestamp.DurationPtr(3 * time.Second), // ActivityID D is expected to timeout using Heartbeat
754+
RetryPolicy: &commonpb.RetryPolicy{
755+
MaximumAttempts: 1, // Disable retry and let it timeout.
756+
},
755757
}}},
756758
}, nil
757759
} else if previousStartedEventID > 0 {
@@ -778,38 +780,37 @@ func (s *integrationSuite) TestActivityTimeouts() {
778780
activityATimedout = true
779781
} else {
780782
failWorkflow = true
781-
failReason = "ActivityID A is expected to timeout with ScheduleToStart"
783+
failReason = "ActivityID A is expected to timeout with ScheduleToStart but it was " + scheduledEvent.GetActivityTaskScheduledEventAttributes().GetActivityId()
782784
}
783785
case enumspb.TIMEOUT_TYPE_SCHEDULE_TO_CLOSE:
784786
if scheduledEvent.GetActivityTaskScheduledEventAttributes().GetActivityId() == "B" {
785787
activityBTimedout = true
786788
} else {
787789
failWorkflow = true
788-
failReason = "ActivityID B is expected to timeout with ScheduleToClose"
790+
failReason = "ActivityID B is expected to timeout with ScheduleToClose but it was " + scheduledEvent.GetActivityTaskScheduledEventAttributes().GetActivityId()
789791
}
790792
case enumspb.TIMEOUT_TYPE_START_TO_CLOSE:
791793
if scheduledEvent.GetActivityTaskScheduledEventAttributes().GetActivityId() == "C" {
792794
activityCTimedout = true
793795
} else {
794796
failWorkflow = true
795-
failReason = "ActivityID C is expected to timeout with StartToClose"
797+
failReason = "ActivityID C is expected to timeout with StartToClose but it was " + scheduledEvent.GetActivityTaskScheduledEventAttributes().GetActivityId()
796798
}
797799
case enumspb.TIMEOUT_TYPE_HEARTBEAT:
798800
if scheduledEvent.GetActivityTaskScheduledEventAttributes().GetActivityId() == "D" {
799801
activityDTimedout = true
800802
} else {
801803
failWorkflow = true
802-
failReason = "ActivityID D is expected to timeout with Heartbeat"
804+
failReason = "ActivityID D is expected to timeout with Heartbeat but it was " + scheduledEvent.GetActivityTaskScheduledEventAttributes().GetActivityId()
803805
}
804806
}
805807
}
806808
}
807809
}
808810

809811
if failWorkflow {
810-
s.Logger.Error("Failing workflow")
812+
s.Logger.Error("Failing workflow: " + failReason)
811813
workflowFailed = true
812-
workflowComplete = true
813814
return []*commandpb.Command{{
814815
CommandType: enumspb.COMMAND_TYPE_FAIL_WORKFLOW_EXECUTION,
815816
Attributes: &commandpb.Command_FailWorkflowExecutionCommandAttributes{FailWorkflowExecutionCommandAttributes: &commandpb.FailWorkflowExecutionCommandAttributes{

service/history/mutableStateBuilder.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2150,6 +2150,7 @@ func (e *mutableStateBuilder) ReplicateActivityTaskScheduledEvent(
21502150
ai.RetryMaximumInterval = attributes.RetryPolicy.GetMaximumInterval()
21512151
ai.RetryMaximumAttempts = attributes.RetryPolicy.GetMaximumAttempts()
21522152
ai.RetryNonRetryableErrorTypes = attributes.RetryPolicy.NonRetryableErrorTypes
2153+
ai.RetryExpirationTime = timestamp.TimePtr(timestamp.TimeValue(ai.ScheduledTime).Add(timestamp.DurationValue(scheduleToCloseTimeout)))
21532154
}
21542155

21552156
e.pendingActivityInfoIDs[scheduleEventID] = ai

0 commit comments

Comments
 (0)