summaryrefslogtreecommitdiff
path: root/test/mjsunit/test-eio-race4.js
blob: 7004ee80a43f37499d3c17094f4ae64237415263 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
process.mixin(require("./common"));

var N = 100;
var j = 0;

for (var i = 0; i < N; i++) {
  // these files don't exist
  fs.stat("does-not-exist-" + i, function (err) {
    if (err) {
      j++; // only makes it to about 17
      puts("finish " + j);
    } else {
      throw new Error("this shouldn't be called");
    }
  }); 
}

process.addListener("exit", function () {
  assert.equal(N, j);
});