Skip to content

Stabilize workflow parallelism test assertion#4

Merged
zebbern merged 1 commit into
mainfrom
codex/stabilize-root-test-runner
Jun 20, 2026
Merged

Stabilize workflow parallelism test assertion#4
zebbern merged 1 commit into
mainfrom
codex/stabilize-root-test-runner

Conversation

@zebbern

@zebbern zebbern commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • replace fragile sleep-duration lower bounds in the workflow parallelism test
  • assert branch overlap, merge ordering, and faster-than-serial runtime instead
  • keeps the test focused on scheduler parallelism rather than setTimeout precision

Verification

  • bun --cwd worker test src/temporal/tests/workflow-runner.test.ts
  • 20 focused runs of the parallelism test
  • bun run typecheck
  • bun run lint
  • bun run test
  • git push pre-push hook reran typecheck and tests successfully

Signed-off-by: zebbern <185730623+zebbern@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 20, 2026 14:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR stabilizes the “workflow parallelism” unit test in the Temporal workflow runner by replacing fragile timer-duration lower-bound assertions with assertions that focus on scheduler behavior (branch overlap, merge ordering, and faster-than-serial runtime).

Changes:

  • Replace per-branch elapsed-time lower-bound assertions with a branch-overlap assertion.
  • Add an assertion that merge starts after both branches complete, and relax the total-runtime upper bound to reflect a serial baseline.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Math.max(branchA.startedAt, branchB.startedAt) < Math.min(branchA.endedAt, branchB.endedAt);
expect(branchesOverlap).toBe(true);

expect(merge.startedAt).toBeGreaterThanOrEqual(Math.max(branchA.endedAt, branchB.endedAt) - 5);
@zebbern zebbern merged commit ed16bc6 into main Jun 20, 2026
6 checks passed
@zebbern zebbern deleted the codex/stabilize-root-test-runner branch June 20, 2026 14:34
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.

2 participants