From d4ee61ffc7938e9a1167aadb94b9cf60e4310fe1 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 10 Jan 2012 11:47:32 -0800 Subject: [PATCH] Add failing test-isolates2.js --- test/simple/test-child-process-fork2.js | 6 +++++- test/simple/{test-isolates.js => test-isolates0.js} | 0 test/simple/test-isolates1.js | 13 +++++++++++++ test/simple/test-isolates2.js | 4 ++-- 4 files changed, 20 insertions(+), 3 deletions(-) rename test/simple/{test-isolates.js => test-isolates0.js} (100%) create mode 100644 test/simple/test-isolates1.js diff --git a/test/simple/test-child-process-fork2.js b/test/simple/test-child-process-fork2.js index 3116320..70c39de 100644 --- a/test/simple/test-child-process-fork2.js +++ b/test/simple/test-child-process-fork2.js @@ -27,7 +27,11 @@ var net = require('net'); var socketCloses = 0; var N = 10; -var n = fork(common.fixturesDir + '/fork2.js'); +var options = { + thread: process.TEST_ISOLATE ? true : false +}; + +var n = fork(common.fixturesDir + '/fork2.js', [], options); var messageCount = 0; diff --git a/test/simple/test-isolates.js b/test/simple/test-isolates0.js similarity index 100% rename from test/simple/test-isolates.js rename to test/simple/test-isolates0.js diff --git a/test/simple/test-isolates1.js b/test/simple/test-isolates1.js new file mode 100644 index 0000000..1823b8f --- /dev/null +++ b/test/simple/test-isolates1.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-fork 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-fork'); + +var numThreads = process.binding('isolates').count(); +assert.ok(numThreads > 1); diff --git a/test/simple/test-isolates2.js b/test/simple/test-isolates2.js index 1823b8f..a3c30c7 100644 --- a/test/simple/test-isolates2.js +++ b/test/simple/test-isolates2.js @@ -3,11 +3,11 @@ if (!process.features.isolates) return; var assert = require('assert'); -// This is the same test as test-child-process-fork except it uses isolates +// This is the same test as test-child-process-fork2 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-fork'); +require('./test-child-process-fork2'); var numThreads = process.binding('isolates').count(); assert.ok(numThreads > 1); -- 2.7.4