Skip to content

Commit efa95c2

Browse files
committed
Fix test-eio-race on Windows
1 parent 3c3ec7b commit efa95c2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/simple/test-eio-race.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,16 @@
1919
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2020
// USE OR OTHER DEALINGS IN THE SOFTWARE.
2121

22-
// libuv-broken
23-
2422

2523
var common = require('../common');
2624
var assert = require('assert');
2725

2826
var count = 100;
2927
var fs = require('fs');
3028

29+
// person.jpg is 57kb. We just need some file that is sufficently large.
30+
var filename = require('path').join(common.fixturesDir, 'person.jpg');
31+
3132
function tryToKillEventLoop() {
3233
console.log('trying to kill event loop ...');
3334

@@ -58,20 +59,19 @@ function tryToKillEventLoop() {
5859

5960
// Generate a lot of thread pool events
6061
var pos = 0;
61-
fs.open('/dev/zero', 'r', 0666, function(err, fd) {
62+
fs.open(filename, 'r', 0666, function(err, fd) {
6263
if (err) throw err;
6364

6465
function readChunk() {
65-
fs.read(fd, 1024, pos, 'binary', function(err, chunk, bytesRead) {
66+
fs.read(fd, 1024, 0, 'binary', function(err, chunk, bytesRead) {
6667
if (err) throw err;
6768
if (chunk) {
6869
pos += bytesRead;
6970
//console.log(pos);
7071
readChunk();
7172
} else {
7273
fs.closeSync(fd);
73-
throw new Exception('/dev/zero shouldn\'t end ' +
74-
'before the issue shows up');
74+
throw new Exception("Shouldn't get EOF");
7575
}
7676
});
7777
}

0 commit comments

Comments
 (0)