From 1ba5b7ea6c98ca4e835d9e7836bdba43b5f0d67f Mon Sep 17 00:00:00 2001 From: Pietro Marchini Date: Mon, 18 Aug 2025 21:25:32 +0200 Subject: [PATCH 1/2] tools: avoid parsing test files twice --- tools/test.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/test.py b/tools/test.py index e27222af3ac519..f9a7bbddee5d87 100755 --- a/tools/test.py +++ b/tools/test.py @@ -788,6 +788,12 @@ def Execute(args, context, timeout=None, env=None, disable_core_files=False, for key, value in env.items(): env_copy[key] = value + # We append NODE_SKIP_FLAG_CHECK (ref: test/common/index.js) + # to avoid parsing the test files twice when looking for + # flags or environment variables defined via // Flags: and // Env: + if not "NODE_SKIP_FLAG_CHECK" in env_copy: + env_copy["NODE_SKIP_FLAG_CHECK"] = "true" + preexec_fn = None def disableCoreFiles(): From c59f9845c72a1add4813c489d14ddc82050597db Mon Sep 17 00:00:00 2001 From: Pietro Marchini Date: Wed, 20 Aug 2025 11:32:14 +0200 Subject: [PATCH 2/2] fixup! tools: avoid parsing test files twice --- tools/test.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/test.py b/tools/test.py index f9a7bbddee5d87..59801e1b07498b 100755 --- a/tools/test.py +++ b/tools/test.py @@ -791,8 +791,7 @@ def Execute(args, context, timeout=None, env=None, disable_core_files=False, # We append NODE_SKIP_FLAG_CHECK (ref: test/common/index.js) # to avoid parsing the test files twice when looking for # flags or environment variables defined via // Flags: and // Env: - if not "NODE_SKIP_FLAG_CHECK" in env_copy: - env_copy["NODE_SKIP_FLAG_CHECK"] = "true" + env_copy["NODE_SKIP_FLAG_CHECK"] = "true" preexec_fn = None