From 7436e395d5e9b90bb28647e1c98f4b7f98ed38e2 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 25 Apr 2026 20:17:10 +0100 Subject: [PATCH] test(node-host): cache native binary fixture lookup --- src/node-host/invoke-system-run-plan.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/node-host/invoke-system-run-plan.test.ts b/src/node-host/invoke-system-run-plan.test.ts index 0c275612ede..ea0f6fc660c 100644 --- a/src/node-host/invoke-system-run-plan.test.ts +++ b/src/node-host/invoke-system-run-plan.test.ts @@ -152,10 +152,16 @@ function uniqueRuntimeBinNames( ]; } +let cachedNativeBinaryFixturePath: string | undefined; + function resolveNativeBinaryFixturePath(): string { + if (cachedNativeBinaryFixturePath) { + return cachedNativeBinaryFixturePath; + } for (const candidate of ["/bin/ls", "/usr/bin/ls", "/bin/echo", "/usr/bin/printf"]) { try { if (fs.statSync(candidate).isFile()) { + cachedNativeBinaryFixturePath = candidate; return candidate; } } catch {