mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
Move the child process code into a fixture and split the test so that it can be run in parallel and it's easier to identify where the failure is coming from. Also use the spawnSyncAndExitWithoutError() utility so that the test shows complete information on failure. Instead of marking all the wasi tests as flaky, only mark the wasi-poll one which is flaking in the CI now. PR-URL: https://github.com/nodejs/node/pull/51836 Refs: https://github.com/nodejs/node/issues/51822 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
44 lines
955 B
JavaScript
44 lines
955 B
JavaScript
// Test version set to preview1
|
|
'use strict';
|
|
|
|
const { spawnSyncAndExitWithoutError } = require('./child_process');
|
|
const fixtures = require('./fixtures');
|
|
const childPath = fixtures.path('wasi-preview-1.js');
|
|
|
|
function testWasiPreview1(args, spawnArgs = {}, expectations = {}) {
|
|
const newEnv = {
|
|
...process.env,
|
|
NODE_DEBUG_NATIVE: 'wasi',
|
|
NODE_PLATFORM: process.platform,
|
|
...spawnArgs.env,
|
|
};
|
|
spawnArgs.env = newEnv;
|
|
|
|
console.log('Testing with --turbo-fast-api-calls:', ...args);
|
|
spawnSyncAndExitWithoutError(
|
|
process.execPath, [
|
|
'--turbo-fast-api-calls',
|
|
childPath,
|
|
...args,
|
|
],
|
|
spawnArgs,
|
|
expectations,
|
|
);
|
|
|
|
console.log('Testing with --no-turbo-fast-api-calls:', ...args);
|
|
spawnSyncAndExitWithoutError(
|
|
process.execPath,
|
|
[
|
|
'--no-turbo-fast-api-calls',
|
|
childPath,
|
|
...args,
|
|
],
|
|
spawnArgs,
|
|
expectations,
|
|
);
|
|
}
|
|
|
|
module.exports = {
|
|
testWasiPreview1,
|
|
};
|