Skip to content

Fix flaky TestWorkflowEngine_ParallelExecution on CI#4333

Merged
JAORMX merged 1 commit intomainfrom
fix-flaky-parallel-execution-test
Mar 24, 2026
Merged

Fix flaky TestWorkflowEngine_ParallelExecution on CI#4333
JAORMX merged 1 commit intomainfrom
fix-flaky-parallel-execution-test

Conversation

@JAORMX
Copy link
Collaborator

@JAORMX JAORMX commented Mar 24, 2026

Summary

  • TestWorkflowEngine_ParallelExecution intermittently fails on CI because it asserts parallel workflow execution completes within 200ms. CI runners (especially with -race) have variable scheduling overhead, causing spurious failures (e.g. 218ms on this run).
  • Replace the tight wall-clock threshold with the maxConcurrent atomic counter as the primary parallelism proof, which directly measures whether steps ran concurrently regardless of machine speed. Keep a generous 2s sanity ceiling and the existing sequence-number ordering assertions for dependency-graph correctness.

Type of change

  • Bug fix

Test plan

  • Manual testing (describe below)

Verified the package compiles cleanly with go build and go vet. The -race test runner is unavailable in the sandbox (no GCC), but the change is a test-only assertion adjustment — no production code affected.

Does this introduce a user-facing change?

No

Generated with Claude Code

@github-actions github-actions bot added the size/XS Extra small PR: < 100 lines changed label Mar 24, 2026
@codecov
Copy link

codecov bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.90%. Comparing base (df1a5cd) to head (e3a1dd6).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4333      +/-   ##
==========================================
- Coverage   69.08%   68.90%   -0.18%     
==========================================
  Files         478      478              
  Lines       48432    48484      +52     
==========================================
- Hits        33457    33410      -47     
- Misses      12314    12338      +24     
- Partials     2661     2736      +75     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The test asserted that parallel workflow execution completes within
200ms, but CI runners (especially with -race) have unpredictable
scheduling delays causing intermittent failures (e.g. 218ms).

Replace the tight wall-clock threshold with the maxConcurrent atomic
counter as the primary parallelism proof, which directly measures
whether steps ran concurrently regardless of machine speed. Keep a
generous 2s sanity ceiling that only fires if the scheduler is
fundamentally broken. The existing sequence-number ordering assertions
already cover dependency-graph correctness.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JAORMX JAORMX force-pushed the fix-flaky-parallel-execution-test branch from df81624 to e3a1dd6 Compare March 24, 2026 12:38
@github-actions github-actions bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Mar 24, 2026
@JAORMX JAORMX merged commit f362107 into main Mar 24, 2026
40 checks passed
@JAORMX JAORMX deleted the fix-flaky-parallel-execution-test branch March 24, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra small PR: < 100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants