Files
vercel__workflow/.changeset/fix-inline-execution-flow-count-race.md
Nathan Rajlich 96e2d3c56f [world-testing] fix flow invocation counter race in inline-execution tests (#2043)
The test server's flow handler awaited flowPOST before incrementing the
invocation counter, which races with the test polling getRun() to see
the completed status. When the workflow completed inside flowPOST and
flushed the run to the DB, the test could observe the completed state
and immediately query /_flow-invocations before the counter was bumped,
yielding a flaky 'expected 0 to be 1' assertion.

Increment the counter before awaiting flowPOST so the count is
observable as soon as the run transitions to completed.
2026-05-20 16:05:48 -07:00

372 B

@workflow/world-testing
@workflow/world-testing
patch

Fix race condition in test server's flow invocation counter that caused intermittent failures in the inline-execution test suite (e.g. "sequential steps complete in a single flow invocation"). The counter is now incremented before awaiting the flow handler, so the count is observable as soon as the run transitions to completed.