mirror of
https://github.com/nodejs/node.git
synced 2025-05-01 08:42:45 +00:00

This commit introduces platform-specific test timeouts for the ARM architectures. ARMv6 is notoriously slow so gets very large timeouts on both the timeout value for each test, as well as certain problematic individual tests. ARMv7 and ARMv8 also get slightly increased headroom. PR-URL: https://github.com/iojs/io.js/pull/1366 Fixes: https://github.com/iojs/io.js/issues/1343 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
48 lines
1.1 KiB
JavaScript
48 lines
1.1 KiB
JavaScript
var common = require('../common');
|
|
var assert = require('assert');
|
|
var path = require('path');
|
|
var fs = require('fs');
|
|
|
|
var emptyFile = path.join(common.fixturesDir, 'empty.txt');
|
|
|
|
fs.open(emptyFile, 'r', function (error, fd) {
|
|
assert.ifError(error);
|
|
|
|
var read = fs.createReadStream(emptyFile, { 'fd': fd });
|
|
|
|
read.once('data', function () {
|
|
throw new Error('data event should not emit');
|
|
});
|
|
|
|
var readEmit = false;
|
|
read.once('end', function () {
|
|
readEmit = true;
|
|
console.error('end event 1');
|
|
});
|
|
|
|
setTimeout(function () {
|
|
assert.equal(readEmit, true);
|
|
}, common.platformTimeout(50));
|
|
});
|
|
|
|
fs.open(emptyFile, 'r', function (error, fd) {
|
|
assert.ifError(error);
|
|
|
|
var read = fs.createReadStream(emptyFile, { 'fd': fd });
|
|
read.pause();
|
|
|
|
read.once('data', function () {
|
|
throw new Error('data event should not emit');
|
|
});
|
|
|
|
var readEmit = false;
|
|
read.once('end', function () {
|
|
readEmit = true;
|
|
console.error('end event 2');
|
|
});
|
|
|
|
setTimeout(function () {
|
|
assert.equal(readEmit, false);
|
|
}, common.platformTimeout(50));
|
|
});
|