Skip to content

Fix activity completion race in workflow tester - #497

Draft
saby1101 wants to merge 1 commit into
cschleiden:mainfrom
stackbox-dev:codex/fix-481-tester-clock-handoff
Draft

saby1101 wants to merge 1 commit into
cschleiden:mainfrom
stackbox-dev:codex/fix-481-tester-clock-handoff

Conversation

@saby1101

@saby1101 saby1101 commented Nov 17, 2026 •

Copy link
Copy Markdown

Fixes #481.

Problem

  • The tester can process an activity result before its goroutine decrements runningActivities. A timer scheduled by the resumed workflow can then use wall-clock time and hit the tester's idle timeout.

Fix

  • runningActivities is decremented inside the result callback before the workflow resumes, for both successful and failed activities.

Tests

  • The regression covers both outcomes and passed 1,000 repetitions with the race detector.
  • Local build, formatting, lint, short race tests, all five backend suites, and SQLite/Redis simple-workflow samples passed with Go 1.25.0.

@saby1101 saby1101 changed the title fix(tester): update activity count before resuming workflows Fix activity completion race in workflow tester Nov 17, 2026
@saby1101
saby1101 marked this pull request as ready for review November 17, 2026 19:30
@saby1101
saby1101 marked this pull request as draft November 17, 2026 19:46

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Race condition in workflow tester causes TM_WallClock mode for instant mocked activities

1 participant