From 67afc945860c68f7610d44cd5ad6abb26f396a6a Mon Sep 17 00:00:00 2001 From: Jessica Laughlin Date: Mon, 6 Apr 2026 10:57:46 -0400 Subject: [PATCH] Add delay before simulated failure in heartbeating sample Without a delay, the Activity fails instantly on retry, making it impossible to observe attempt count after Reset. The 5s sleep gives time to verify the Activity state in the UI. Co-Authored-By: Claude Opus 4.6 --- retryactivity/retry_activity_workflow.go | 1 + 1 file changed, 1 insertion(+) diff --git a/retryactivity/retry_activity_workflow.go b/retryactivity/retry_activity_workflow.go index f18a2ca8..fc9302e4 100644 --- a/retryactivity/retry_activity_workflow.go +++ b/retryactivity/retry_activity_workflow.go @@ -60,6 +60,7 @@ func BatchProcessingActivity(ctx context.Context, firstTaskID, batchSize int, pr // Inject a 95% failure rate before doing any work on this task. if rand.Intn(100) < 95 { logger.Info("Simulating transient failure", "TaskID", i) + time.Sleep(5 * time.Second) return temporal.NewApplicationError("transient error", "SomeType") }