node/test/disabled/test-eio-race4.js

22 lines
451 B
JavaScript
Raw Normal View History

2010-12-05 07:20:34 +08:00
var common = require('../common');
var assert = require('assert');
var fs = require('fs');
var N = 100;
var j = 0;
for (var i = 0; i < N; i++) {
2010-02-20 08:02:30 +08:00
// these files don't exist
fs.stat('does-not-exist-' + i, function(err) {
2010-02-20 08:02:30 +08:00
if (err) {
j++; // only makes it to about 17
console.log('finish ' + j);
2010-02-20 08:02:30 +08:00
} else {
throw new Error('this shouldn\'t be called');
2010-02-20 08:02:30 +08:00
}
2010-06-30 14:12:46 +08:00
});
}
process.on('exit', function() {
assert.equal(N, j);
});