test: extend timeout in Debug mode
authorRich Trott <rtrott@gmail.com>
Sat, 26 Dec 2015 23:04:56 +0000 (15:04 -0800)
committerMyles Borins <mborins@us.ibm.com>
Tue, 19 Jan 2016 19:52:40 +0000 (11:52 -0800)
Debug mode slows execution speed. There is work afoot to enable Debug
mode runs on the continuous integration infrastructure for the project.
Some tests are timing out, such as test-net-GH-5504.js.

This change doubles the timeout returned from `common.platformTimeout()`
when running in Debug mode. It also removes an unused variable from the
aforementioned test-net-GH-5504.js.

PR-URL: https://github.com/nodejs/node/pull/4431
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
test/common.js
test/sequential/test-net-GH-5504.js

index c1012e7..5f18fec 100644 (file)
@@ -255,6 +255,9 @@ exports.spawnPwd = function(options) {
 };
 
 exports.platformTimeout = function(ms) {
+  if (process.config.target_defaults.default_configuration === 'Debug')
+    ms = 2 * ms;
+
   if (process.arch !== 'arm')
     return ms;
 
index 9526993..179b3ae 100644 (file)
@@ -1,6 +1,5 @@
 'use strict';
 var common = require('../common');
-var assert = require('assert');
 
 // this test only fails with CentOS 6.3 using kernel version 2.6.32
 // On other linuxes and darwin, the `read` call gets an ECONNRESET in