summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Yeates <yeatesgraeme@gmail.com>2016-11-14 09:31:32 -0500
committerGitHub <noreply@github.com>2016-11-14 09:31:32 -0500
commitb4d794c4b9c0c3406007297a06a08525d008ba51 (patch)
tree754c271f8028d92cb35548d27a1f7b322e9b455b
parent9cc01fd30dc05e4df43a6ec67b3fbd5d44869457 (diff)
parent271f4e6c95bff19bd7e961c77241e1474ba0b713 (diff)
downloadasync-b4d794c4b9c0c3406007297a06a08525d008ba51.tar.gz
Merge pull request #1321 from caolan/test-retry
Retry flaky tests several times when they fail
-rw-r--r--mocha_test/queue.js6
-rw-r--r--mocha_test/retry.js4
2 files changed, 10 insertions, 0 deletions
diff --git a/mocha_test/queue.js b/mocha_test/queue.js
index e4a29e4..6b09ea8 100644
--- a/mocha_test/queue.js
+++ b/mocha_test/queue.js
@@ -4,6 +4,8 @@ var assert = require('assert');
describe('queue', function(){
+ // several tests of these tests are flakey with timing issues
+ this.retries(3);
it('basics', function(done) {
@@ -218,6 +220,8 @@ describe('queue', function(){
});
it('push without callback', function(done) {
+ this.retries(3); // test can be flakey
+
var call_order = [],
delays = [40,20,60,20];
@@ -349,6 +353,8 @@ describe('queue', function(){
});
it('pause', function(done) {
+ this.retries(3); // sometimes can be flakey to timing issues
+
var call_order = [],
task_timeout = 80,
pause_timeout = task_timeout * 2.5,
diff --git a/mocha_test/retry.js b/mocha_test/retry.js
index 757b7ab..d3a5d22 100644
--- a/mocha_test/retry.js
+++ b/mocha_test/retry.js
@@ -55,6 +55,8 @@ describe("retry", function () {
});
it('retry with interval when all attempts fail',function(done) {
+ this.retries(3); // this test is flakey due to timing issues
+
var times = 3;
var interval = 50;
var callCount = 0;
@@ -208,6 +210,8 @@ describe("retry", function () {
});
it('retry with interval when some attempts fail and error test returns false at some invokation',function(done) {
+ this.retries(3); // flakey test
+
var interval = 50;
var callCount = 0;
var error = 'ERROR';