}
};
+exports.platformTimeout = function(ms) {
+ if (process.arch !== 'arm')
+ return ms;
+
+ if (process.config.variables.arm_version === '6')
+ return 6 * ms; // ARMv6
+
+ return 2 * ms; // ARMv7 and up.
+};
+
var knownGlobals = [setTimeout,
setInterval,
setImmediate,
server.listen(common.PORT, '127.0.0.1');
- var timeElasped = 0;
+ var timeElapsed = 0;
var closeServer = function() {
console.error('[m] closeServer');
var startTime = Date.now();
server.on('close', function() {
console.error('[m] emit(close)');
- timeElasped = Date.now() - startTime;
+ timeElapsed = Date.now() - startTime;
});
console.error('[m] calling server.close');
}, 200);
};
+ var min = 190;
+ var max = common.platformTimeout(1500);
process.on('exit', function() {
assert.equal(disconnected, count);
assert.equal(connected, count);
assert.ok(closeEmitted);
- assert.ok(timeElasped >= 190 && timeElasped <= 1000,
- 'timeElasped was not between 190 and 1000 ms');
+ assert.ok(timeElapsed >= min && timeElapsed <= max,
+ `timeElapsed was not between ${min} and ${max} ms:` +
+ `${timeElapsed}`);
});
}
setTimeout(function testTimedOut() {
assert(false, 'test timed out.');
-}, 6000).unref();
+}, common.platformTimeout(3000)).unref();
process.on('exit', function onExit() {
// Kill processes in reverse order to avoid timing problems on Windows where
setTimeout(function () {
assert.equal(readEmit, true);
- }, 50);
+ }, common.platformTimeout(50));
});
fs.open(emptyFile, 'r', function (error, fd) {
setTimeout(function () {
assert.equal(readEmit, false);
- }, 50);
+ }, common.platformTimeout(50));
});
setTimeout(function() {
process.removeListener('uncaughtException', catcher);
throw new Error('Taking too long!');
-}, 1000).unref();
+}, common.platformTimeout(1000)).unref();
process.on('uncaughtException', catcher);
var errors = 0;
' });\n' +
'});"";\n');
- setTimeout(child.stdin.end.bind(child.stdin), 200);
+ setTimeout(child.stdin.end.bind(child.stdin), common.platformTimeout(200));
}
});
var timer = setTimeout(function() {
console.log('not ok - timed out');
process.exit(1);
-}, 500);
+}, common.platformTimeout(500));
function onconnection(conn) {
conn.on('data', function(c) {
server.listen(common.PORT, function() {
var socket = net.connect(common.PORT, function() {
- socket.setTimeout(240, assert.fail);
+ socket.setTimeout(common.platformTimeout(240), function() {
+ throw new Error('timeout');
+ });
var tsocket = tls.connect({
socket: socket,
var gotToEnd = false;
var timeoutId = setTimeout(function() {
throw new Error('timeout!');
-}, 1000); // give node + the repl 1 second to boot up
+}, common.platformTimeout(1000)); // give node + the repl 1 second to boot up
cp.stdout.setEncoding('utf8');
setTimeout(function() {
throw new Error('hang');
});
- }, 4000).unref();
+ }, common.platformTimeout(2000)).unref();
var s = spawn(node, [__filename, 'server'], opt);
var c;
'debug' : ['--enable-slow-asserts', '--debug-code', '--verify-heap'],
'release' : []}
TIMEOUT_SCALEFACTOR = {
- 'arm' : { 'debug' : 8, 'release' : 2 }, # The ARM buildbots are slow.
- 'ia32' : { 'debug' : 4, 'release' : 1 } }
+ 'armv6' : { 'debug' : 12, 'release' : 3 }, # The ARM buildbots are slow.
+ 'arm' : { 'debug' : 8, 'release' : 2 },
+ 'ia32' : { 'debug' : 4, 'release' : 1 } }
class Context(object):
def GuessArchitecture():
id = platform.machine()
id = id.lower() # Windows 7 capitalizes 'AMD64'.
- if id.startswith('arm') or id == 'aarch64':
+ if id.startswith('armv6'): # Can return 'armv6l'.
+ return 'armv6'
+ elif id.startswith('arm') or id == 'aarch64':
return 'arm'
elif (not id) or (not re.match('(x|i[3-6])86$', id) is None):
return 'ia32'