Skip to content

Commit 8fb28c5

Browse files
author
Ricky Ng-Adam
committed
test timeout value modifiable globally with TEST_TIMEOUT env variable
1 parent 1345516 commit 8fb28c5

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

test/integration/client/heroku-pgpass-tests.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ test('uses password file when PGPASSFILE env variable is set', function() {
3535
done();
3636
pg.end();
3737
}))
38-
}, 15000));
38+
}));
3939
});

test/integration/client/heroku-ssl-tests.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ test('connection with config ssl = true', function() {
2424
done();
2525
pg.end();
2626
}))
27-
}, 15000));
27+
}));
2828
});

test/test-helper.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,13 @@ assert.lengthIs = function(actual, expectedLength) {
133133

134134
var expect = function(callback, timeout) {
135135
var executed = false;
136-
timeout = timeout || 5000;
136+
timeout = timeout || parseInt(process.env.TEST_TIMEOUT) || 5000;
137137
var id = setTimeout(function() {
138-
assert.ok(executed, "Expected execution of function to be fired within " + timeout + ' milliseconds');
138+
assert.ok(executed,
139+
"Expected execution of function to be fired within " + timeout
140+
+ " milliseconds " +
141+
+ " (hint: export TEST_TIMEOUT=<timeout in milliseconds>"
142+
+ " to change timeout globally)");
139143
}, timeout)
140144

141145
if(callback.length < 3) {

0 commit comments

Comments
 (0)