Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change isolate test to demo EIO bug

  • Loading branch information...
commit 7a4dd50ec0e41cdbec39151ba31ef0bfa137f573 1 parent 8e5e478
@ry ry authored committed
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());
}
Please sign in to comment.
Something went wrong with that request. Please try again.