Skip to content

Commit 1345516

Browse files
author
Ricky Ng-Adam
committed
bump up timeout for tests against AWS from 5s to 15s
1 parent 4c8f489 commit 1345516

File tree

3 files changed

+29
-22
lines changed

3 files changed

+29
-22
lines changed

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

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,18 @@ var config = {
2222
ssl: true
2323
};
2424

25-
// connect & disconnect from heroku
26-
pg.connect(config, assert.success(function(client, done) {
27-
client.query('SELECT NOW() as time', assert.success(function(res) {
28-
assert(res.rows[0].time.getTime());
29-
30-
// cleanup ... remove the env variable
31-
delete process.env.PGPASSFILE;
32-
33-
done();
34-
pg.end();
35-
}))
36-
}));
25+
test('uses password file when PGPASSFILE env variable is set', function() {
26+
// connect & disconnect from heroku
27+
pg.connect(config, assert.calls(function(err, client, done) {
28+
assert.isNull(err);
29+
client.query('SELECT NOW() as time', assert.success(function(res) {
30+
assert(res.rows[0].time.getTime());
31+
32+
// cleanup ... remove the env variable
33+
delete process.env.PGPASSFILE;
34+
35+
done();
36+
pg.end();
37+
}))
38+
}, 15000));
39+
});

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ var config = {
1515
ssl: true
1616
};
1717

18-
//connect & disconnect from heroku
19-
pg.connect(config, assert.success(function(client, done) {
20-
client.query('SELECT NOW() as time', assert.success(function(res) {
21-
assert(res.rows[0].time.getTime());
22-
done();
23-
pg.end();
24-
}))
25-
}));
18+
test('connection with config ssl = true', function() {
19+
//connect & disconnect from heroku
20+
pg.connect(config, assert.calls(function(err, client, done) {
21+
assert.isNull(err);
22+
client.query('SELECT NOW() as time', assert.success(function(res) {
23+
assert(res.rows[0].time.getTime());
24+
done();
25+
pg.end();
26+
}))
27+
}, 15000));
28+
});

test/test-helper.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,10 @@ assert.lengthIs = function(actual, expectedLength) {
133133

134134
var expect = function(callback, timeout) {
135135
var executed = false;
136+
timeout = timeout || 5000;
136137
var id = setTimeout(function() {
137-
assert.ok(executed, "Expected execution of function to be fired");
138-
}, timeout || 5000)
138+
assert.ok(executed, "Expected execution of function to be fired within " + timeout + ' milliseconds');
139+
}, timeout)
139140

140141
if(callback.length < 3) {
141142
return function(err, queryResult) {

0 commit comments

Comments
 (0)