test_runner: wait for filtered suite build#64208
Conversation
|
Review requested:
|
Signed-off-by: semimikoh <ejffjeosms@gmail.com>
3db8275 to
55f1419
Compare
This part sounds to me like something an LLM would write, and it doesn't really make a lot of sense to me. if the binary is old, |
|
@atlowChemi You're right, and I'm sorry about that verification note β it was misleading. I shouldn't have written that the old binary was "incompatible" and left the change unverified. The actual local blocker was a toolchain issue (the Apple clang / Command Line Tools Having actually run it now: you're correct that this change deadlocks. But while verifying, I found the deadlock is not specific to filtering β it reproduces with no name pattern at all: // repro.mjs
import test from 'node:test';
await test('t', async () => {});The hang is a circular wait in the
So fixing this in |
Problem
When a filtered
Suitehas an async body, it can still be building itschildren when the filtered run path calls
postRun(). If the suite bodyuses
await test(...), the filtered child can be registered after thesuite is already being cleaned up, causing the child to be cancelled.
That leaves the run with no reported test failures, but a non-zero exit
code due to the cancelled test.
Fix
Make
Suite#filteredRun()wait forbuildSuitebefore delegating to thebase filtered run implementation. This keeps filtered suites from being
cleaned up while their async body is still registering children.
Test
Adds a regression fixture with awaited suites and awaited tests, then runs
it with
--test --test-isolation=none --test-name-pattern=C. The testasserts the run exits successfully and does not report any cancelled tests.
Verification
$ git diff --cached --checkThe full regression test was not completed locally because the existing
out/Release/nodebinary in this checkout isv22.22.2-preand is notcompatible with the current
maintest suite; the existingtest-runner-no-isolation-filteringcases fail with status 9 before thischange can be validated.
Fixes: #64203