Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Fix test-eio-race on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Oct 21, 2011
1 parent 3c3ec7b commit efa95c2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/simple/test-eio-race.js
Expand Up @@ -19,15 +19,16 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

// libuv-broken


var common = require('../common');
var assert = require('assert');

var count = 100;
var fs = require('fs');

// person.jpg is 57kb. We just need some file that is sufficently large.
var filename = require('path').join(common.fixturesDir, 'person.jpg');

function tryToKillEventLoop() {
console.log('trying to kill event loop ...');

Expand Down Expand Up @@ -58,20 +59,19 @@ function tryToKillEventLoop() {

// Generate a lot of thread pool events
var pos = 0;
fs.open('/dev/zero', 'r', 0666, function(err, fd) {
fs.open(filename, 'r', 0666, function(err, fd) {
if (err) throw err;

function readChunk() {
fs.read(fd, 1024, pos, 'binary', function(err, chunk, bytesRead) {
fs.read(fd, 1024, 0, 'binary', function(err, chunk, bytesRead) {
if (err) throw err;
if (chunk) {
pos += bytesRead;
//console.log(pos);
readChunk();
} else {
fs.closeSync(fd);
throw new Exception('/dev/zero shouldn\'t end ' +
'before the issue shows up');
throw new Exception("Shouldn't get EOF");
}
});
}
Expand Down

0 comments on commit efa95c2

Please sign in to comment.