diff options
author | Daniel Bevenius <daniel.bevenius@gmail.com> | 2019-01-30 10:19:24 +0100 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2019-02-04 05:36:39 +0100 |
commit | d6a32cfe7ca32b8382d195a1dee460d78f749562 (patch) | |
tree | 480501b8a9d7e0f4ed514b3022bd867f317f07ea /test/parallel/test-worker-cleanexit-with-moduleload.js | |
parent | 46af4c1d01b90ee6845abf40c813f384286f3ad4 (diff) | |
download | android-node-v8-d6a32cfe7ca32b8382d195a1dee460d78f749562.tar.gz android-node-v8-d6a32cfe7ca32b8382d195a1dee460d78f749562.tar.bz2 android-node-v8-d6a32cfe7ca32b8382d195a1dee460d78f749562.zip |
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>
Diffstat (limited to 'test/parallel/test-worker-cleanexit-with-moduleload.js')
-rw-r--r-- | test/parallel/test-worker-cleanexit-with-moduleload.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/test/parallel/test-worker-cleanexit-with-moduleload.js b/test/parallel/test-worker-cleanexit-with-moduleload.js index 172544f50a..d4316cfe23 100644 --- a/test/parallel/test-worker-cleanexit-with-moduleload.js +++ b/test/parallel/test-worker-cleanexit-with-moduleload.js @@ -1,5 +1,5 @@ 'use strict'; -require('../common'); +const common = require('../common'); // Harden the thread interactions on the exit path. // Ensure workers are able to bail out safe at @@ -9,10 +9,15 @@ require('../common'); // preferrably in the C++ land. 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++) { - new Worker("const modules = ['fs', 'assert', 'async_hooks'," + - "'buffer', 'child_process', 'net', 'http', 'https', 'os'," + - "'path', 'v8', 'vm'];" + + new Worker(`const modules = [${modules.map((m) => `'${m}'`)}];` + 'modules.forEach((module) => {' + 'const m = require(module);' + '});', { eval: true }); |