Description
Something I found very useful in V8's test runner (our Python test runner is a fork of a very old version of this) is the support of the // Environment variables
comment (similar to the // Flags
comment, this instructs the test runner to pass a particular flag when running the test)
The way it's implemented in V8 can be found in e.g. here
node/deps/v8/test/intl/testcfg.py
Line 34 in 17a74dd
We can probably just port similar logic to our fork in e.g. here
Line 61 in a790901
It would be handy to leave more logs in flaky tests via the use of // Env: NODE_DEBUG=foo
or // Env: NODE_DEBUG_NATIVE=foo
- trying to set the flag in the entire test job or the entire test suite would be uncanny since many tests also check that stdout/stderr is empty, and we probably only want to do this for selected flaky tests that don't care about stdout/stderr so that they leave more traces in the CI logs. This would also help simplifying many tests that only spawn child processes to customize the environment varaibles.