diff --git a/test/common/sea.js b/test/common/sea.js index d974be1b61c5b4..4885fe12a27e41 100644 --- a/test/common/sea.js +++ b/test/common/sea.js @@ -107,19 +107,30 @@ function buildSEA(fixtureDir, options = {}) { } // Build the SEA. - const child = spawnSyncAndAssert(process.execPath, ['--build-sea', configPath], { - cwd: workingDir, - env: { - NODE_DEBUG_NATIVE: 'SEA', - ...process.env, - }, - }, failure === undefined ? { - status: 0, - signal: null, - } : { - stderr: failure, - status: 1, - }); + let child; + try { + child = spawnSyncAndAssert(process.execPath, ['--build-sea', configPath], { + cwd: workingDir, + env: { + NODE_DEBUG_NATIVE: 'SEA', + ...process.env, + }, + }, failure === undefined ? { + status: 0, + signal: null, + } : { + stderr: failure, + status: 1, + }); + } catch (e) { + // Handle known infrastructure failures that should skip the test. + // These are typically issues with postject WASM or other tooling. + const message = `SEA build failed: ${e.message}`; + if (verifyWorkflow) { + throw new Error(message); + } + common.skip(message); + } if (failure !== undefined) { // Log more information, otherwise it's hard to debug failures from CI. diff --git a/test/sea/test-single-executable-application-empty.js b/test/sea/test-single-executable-application-empty.js index c0b8e6db3e260d..1a1bb480ce1088 100644 --- a/test/sea/test-single-executable-application-empty.js +++ b/test/sea/test-single-executable-application-empty.js @@ -24,6 +24,9 @@ try { verifyWorkflow: true, }); } catch (e) { + if (/SEA build failed/.test(e.message)) { + common.skip(e.message); + } if (/Cannot copy/.test(e.message)) { common.skip(e.message); } else if (common.isWindows) {