test: add hasCrypto to worker-cleanexit-with-moduleload
Currently, this test fails when configured --without-ssl: === release test-worker-cleanexit-with-moduleload === Path: parallel/test-worker-cleanexit-with-moduleload events.js:173 throw er; // Unhandled 'error' event ^ internal/util.js:101 throw new ERR_NO_CRYPTO(); ^ Error [ERR_NO_CRYPTO]: Node.js is not compiled with OpenSSL crypto support This commit as a check for crypto so that this test is skipped if there is no crypto support. PR-URL: https://github.com/nodejs/node/pull/25811 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
46af4c1d01
commit
d6a32cfe7c
@ -1,5 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
require('../common');
|
const common = require('../common');
|
||||||
|
|
||||||
// Harden the thread interactions on the exit path.
|
// Harden the thread interactions on the exit path.
|
||||||
// Ensure workers are able to bail out safe at
|
// Ensure workers are able to bail out safe at
|
||||||
@ -9,10 +9,15 @@ require('../common');
|
|||||||
// preferrably in the C++ land.
|
// preferrably in the C++ land.
|
||||||
|
|
||||||
const { Worker } = require('worker_threads');
|
const { Worker } = require('worker_threads');
|
||||||
|
const modules = [ 'fs', 'assert', 'async_hooks', 'buffer', 'child_process',
|
||||||
|
'net', 'http', 'os', 'path', 'v8', 'vm'
|
||||||
|
];
|
||||||
|
if (common.hasCrypto) {
|
||||||
|
modules.push('https');
|
||||||
|
}
|
||||||
|
|
||||||
for (let i = 0; i < 10; i++) {
|
for (let i = 0; i < 10; i++) {
|
||||||
new Worker("const modules = ['fs', 'assert', 'async_hooks'," +
|
new Worker(`const modules = [${modules.map((m) => `'${m}'`)}];` +
|
||||||
"'buffer', 'child_process', 'net', 'http', 'https', 'os'," +
|
|
||||||
"'path', 'v8', 'vm'];" +
|
|
||||||
'modules.forEach((module) => {' +
|
'modules.forEach((module) => {' +
|
||||||
'const m = require(module);' +
|
'const m = require(module);' +
|
||||||
'});', { eval: true });
|
'});', { eval: true });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user