From 43501a24ab4e273d9588ede11c630cc71c324ef2 Mon Sep 17 00:00:00 2001 From: Christopher Hiller Date: Fri, 29 Sep 2017 23:08:03 -0700 Subject: [PATCH] reduce noise about slow tests; make a few tests faster, etc. --- Makefile | 2 +- test/integration/fixtures/options/delay.fixture.js | 2 +- test/integration/fixtures/retries/async.fixture.js | 2 +- test/integration/options.spec.js | 1 + test/integration/regression.spec.js | 1 + test/unit/duration.spec.js | 2 +- test/unit/timeout.spec.js | 5 +++-- 7 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 1724d30e8d..7b2bd1e689 100644 --- a/Makefile +++ b/Makefile @@ -70,7 +70,7 @@ test-unit: test-integration: @printf "==> [Test :: Integrations]\n" - $(call test_node,integration) --timeout 5000 \ + $(call test_node,integration) --timeout 5000 --slow 500 \ test/integration/*.spec.js test-compilers: diff --git a/test/integration/fixtures/options/delay.fixture.js b/test/integration/fixtures/options/delay.fixture.js index b2d49217db..b16db65946 100644 --- a/test/integration/fixtures/options/delay.fixture.js +++ b/test/integration/fixtures/options/delay.fixture.js @@ -1,7 +1,7 @@ 'use strict'; var assert = require('assert'); -var delay = 500; +var delay = 200; setTimeout(function () { describe('delayed execution', function () { diff --git a/test/integration/fixtures/retries/async.fixture.js b/test/integration/fixtures/retries/async.fixture.js index 56d067fc05..48dda97803 100644 --- a/test/integration/fixtures/retries/async.fixture.js +++ b/test/integration/fixtures/retries/async.fixture.js @@ -19,7 +19,7 @@ describe('retries', function () { }); it('should allow override and run appropriate hooks', function (done) { - this.timeout(200); + this.timeout(100); this.retries(2); console.log('TEST', times); if (++times < 3) { diff --git a/test/integration/options.spec.js b/test/integration/options.spec.js index dbd7acbe4b..15a46ebf2d 100644 --- a/test/integration/options.spec.js +++ b/test/integration/options.spec.js @@ -349,6 +349,7 @@ describe('options', function () { var runExit = function (shouldExit, behavior) { return function (done) { this.timeout(0); + this.slow(3000); var didExit = true; var t; var args = behaviors[behavior] ? [behaviors[behavior]] : []; diff --git a/test/integration/regression.spec.js b/test/integration/regression.spec.js index 14a1a164f3..537da6ae1c 100644 --- a/test/integration/regression.spec.js +++ b/test/integration/regression.spec.js @@ -52,6 +52,7 @@ describe('regressions', function () { // on a modern MBP takes ±5 seconds on node 4.0, but on older laptops with node 0.12 ±40 seconds. // Could easily take longer on even weaker machines (Travis-CI containers for example). this.timeout(120000); + this.slow(12000); run('regression/issue-1991.fixture.js', [], function (err, res) { if (err) { done(err); diff --git a/test/unit/duration.spec.js b/test/unit/duration.spec.js index 0194d4408c..45d2681bcc 100644 --- a/test/unit/duration.spec.js +++ b/test/unit/duration.spec.js @@ -18,7 +18,7 @@ describe('durations', function () { }); describe('when fast', function () { - it('should highlight in green', function (done) { + it('should not highlight', function (done) { setTimeout(function () { done(); }, 10); diff --git a/test/unit/timeout.spec.js b/test/unit/timeout.spec.js index b3fc632a0d..066e70d111 100644 --- a/test/unit/timeout.spec.js +++ b/test/unit/timeout.spec.js @@ -14,10 +14,10 @@ describe('timeouts', function () { }); it('should allow overriding per-test', function (done) { - this.timeout(1000); + this.timeout(200); setTimeout(function () { done(); - }, 300); + }, 50); }); describe('disabling', function () { @@ -56,6 +56,7 @@ describe('timeouts', function () { this.timeout(4); it('should suppress timeout(4)', function (done) { + this.slow(100); // The test is in the before() call. this.enableTimeouts(false); setTimeout(done, 50);