From e1b829d2a502b5181d7a9d13e79d839ba0601421 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 10 Jan 2012 12:04:16 -0800 Subject: [PATCH] Add broken test-isolates3.js --- test/simple/test-child-process-fork3.js | 6 +++++- test/simple/test-isolates3.js | 13 +++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 test/simple/test-isolates3.js diff --git a/test/simple/test-child-process-fork3.js b/test/simple/test-child-process-fork3.js index a8a8985f05824a..21d547e0266adf 100644 --- a/test/simple/test-child-process-fork3.js +++ b/test/simple/test-child-process-fork3.js @@ -25,8 +25,12 @@ var fork = require('child_process').fork; var filename = common.fixturesDir + '/destroy-stdin.js'; +var options = { + thread: process.TEST_ISOLATE ? true : false +}; + // Ensure that we don't accidentally close fd 0 and // reuse it for something else, it causes all kinds // of obscure bugs. process.stdin.destroy(); -fork(filename).stdin.on('end', process.exit); +fork(filename, [], options).stdin.on('end', process.exit); diff --git a/test/simple/test-isolates3.js b/test/simple/test-isolates3.js new file mode 100644 index 00000000000000..d354bca01d241e --- /dev/null +++ b/test/simple/test-isolates3.js @@ -0,0 +1,13 @@ +// Skip this test if Node is not compiled with isolates support. +if (!process.features.isolates) return; + +var assert = require('assert'); + +// This is the same test as test-child-process-fork3 except it uses isolates +// instead of processes. process.TEST_ISOLATE is a ghetto method of passing +// some information into the other test. +process.TEST_ISOLATE = true; +require('./test-child-process-fork3'); + +var numThreads = process.binding('isolates').count(); +assert.ok(numThreads > 1);