node/test/simple/test-eio-race2.js

23 lines
480 B
JavaScript
Raw Normal View History

2010-02-25 14:36:17 +08:00
process.mixin(require("../common"));
var testTxt = path.join(fixturesDir, "x.txt");
2010-02-12 17:04:14 +08:00
var fs = require('fs');
setTimeout(function () {
// put this in a timeout, just so it doesn't get bunched up with the
// require() calls..
N = 30;
for (var i=0; i < N; i++) {
puts("start " + i);
2010-02-20 08:02:30 +08:00
fs.readFile(testTxt, function(err, data) {
if (err) {
puts("error! " + e);
process.exit(1);
} else {
puts("finish");
}
});
}
}, 100);