0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/simple/test-eio-race4.js

21 lines
410 B
JavaScript

require("../common");
var fs = require('fs');
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);
});