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

25 lines
570 B
JavaScript
Raw Normal View History

2010-12-05 07:20:34 +08:00
var common = require('../common');
var assert = require('assert');
var path = require('path');
var testTxt = path.join(common.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..
2010-12-05 07:20:34 +08:00
var N = 30;
for (var i=0; i < N; i++) {
console.log("start " + i);
2010-02-20 08:02:30 +08:00
fs.readFile(testTxt, function(err, data) {
if (err) {
console.log("error! " + e);
2010-02-20 08:02:30 +08:00
process.exit(1);
} else {
console.log("finish");
2010-02-20 08:02:30 +08:00
}
});
}
}, 100);