Skip to content
Browse files

Change isolate test to demo EIO bug

  • Loading branch information...
1 parent 8e5e478 commit 7a4dd50ec0e41cdbec39151ba31ef0bfa137f573 @ry ry committed with Dec 18, 2011
Showing with 21 additions and 10 deletions.
  1. +21 −10 test/simple/test-isolates.js
View
31 test/simple/test-isolates.js
@@ -1,4 +1,5 @@
var fs = require('fs');
+var http = require('http');
console.log("count: %d", process._countIsolate());
@@ -7,21 +8,31 @@ if (process.tid === 1) {
//process._joinIsolate(isolate);
console.error("master");
fs.stat(__dirname, function(err, stat) {
- if (err) {
- console.error("thread 1 error!");
- throw err;
- }
- console.error('thread 1', stat);
+ if (err) throw err;
+ console.error('thread 1', stat.mtime);
});
+
+ setTimeout(function() {
+ fs.stat(__dirname, function(err, stat) {
+ if (err) throw err;
+ console.error('thread 1', stat.mtime);
+ });
+ }, 500);
+
console.log("thread 1 count: %d", process._countIsolate());
} else {
console.error("slave");
fs.stat(__dirname, function(err, stat) {
- if (err) {
- console.error("thread 2 error!");
- throw err;
- }
- console.error('thread 2', stat);
+ if (err) throw err;
+ console.error('thread 2', stat.mtime);
});
+
+ setTimeout(function() {
+ fs.stat(__dirname, function(err, stat) {
+ if (err) throw err;
+ console.error('thread 2', stat.mtime);
+ });
+ }, 500);
+
console.error("thread 2 count: %d", process._countIsolate());
}

0 comments on commit 7a4dd50

Please sign in to comment.
Something went wrong with that request. Please try again.