From d3a10c70f1b43d91bc1239365ff04b02cd0f173a Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Sat, 3 Mar 2018 17:25:58 +0800 Subject: [PATCH] test: skip postmortem metadata test when nm fails On Windows with msys installation, `nm` is available but it is not able to grab symbols from the Windows build. Skipping the test if nm outputs anything to stderr fixes that. Backport-PR-URL: https://github.com/nodejs/node/pull/22380 PR-URL: https://github.com/nodejs/node/pull/19107 Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Matheus Marchini Reviewed-By: James M Snell --- test/parallel/test-postmortem-metadata.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/parallel/test-postmortem-metadata.js b/test/parallel/test-postmortem-metadata.js index 75cc7bdda33cef..1860028333e032 100644 --- a/test/parallel/test-postmortem-metadata.js +++ b/test/parallel/test-postmortem-metadata.js @@ -23,6 +23,11 @@ const nm = spawnSync('nm', args); if (nm.error && nm.error.errno === 'ENOENT') common.skip('nm not found on system'); +const stderr = nm.stderr.toString(); +if (stderr.length > 0) { + common.skip(`Failed to execute nm: ${stderr}`); +} + const symbolRe = /\s_?(v8dbg_.+)$/; const symbols = nm.stdout.toString().split('\n').reduce((filtered, line) => { const match = line.match(symbolRe);