From 59079b27e303b8042968f289bdcebd75f167b1bd Mon Sep 17 00:00:00 2001 From: Nad Alaba <37968805+nadalaba@users.noreply.github.com> Date: Mon, 4 May 2026 20:10:23 +0300 Subject: [PATCH] test: fix cp.exec-any-shells test on windows with wsl Signed-off-by: Nad Alaba <37968805+nadalaba@users.noreply.github.com> --- .../test-child-process-exec-any-shells-windows.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-child-process-exec-any-shells-windows.js b/test/parallel/test-child-process-exec-any-shells-windows.js index 5c34bc77308cc3..38ee46e666fdf1 100644 --- a/test/parallel/test-child-process-exec-any-shells-windows.js +++ b/test/parallel/test-child-process-exec-any-shells-windows.js @@ -61,7 +61,14 @@ cp.exec('where bash', common.mustCall((error, stdout) => { const lines = stdout.trim().split(/[\r\n]+/g); for (let i = 0; i < lines.length; ++i) { const bashPath = lines[i].trim(); + const bashPathLower = bashPath.toLowerCase(); + + const isWSLBash = + bashPathLower.includes('windowsapps') || + bashPathLower.includes('\\system32\\bash.exe'); + test(bashPath); - testCopy(`bash_${i}.exe`, bashPath); + // Skip WSL bash (cannot be symlinked) + if (!isWSLBash) testCopy(`bash_${i}.exe`, bashPath); } }));