mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-18 15:55:05 +00:00
Merge pull request #577 from letsface/bump-aws-tests-timeout
bump up timeout for tests against AWS from 5s to 15s
This commit is contained in:
commit
740d0a6c04
@ -22,15 +22,18 @@ var config = {
|
||||
ssl: true
|
||||
};
|
||||
|
||||
// connect & disconnect from heroku
|
||||
pg.connect(config, assert.success(function(client, done) {
|
||||
client.query('SELECT NOW() as time', assert.success(function(res) {
|
||||
assert(res.rows[0].time.getTime());
|
||||
test('uses password file when PGPASSFILE env variable is set', function() {
|
||||
// connect & disconnect from heroku
|
||||
pg.connect(config, assert.calls(function(err, client, done) {
|
||||
assert.isNull(err);
|
||||
client.query('SELECT NOW() as time', assert.success(function(res) {
|
||||
assert(res.rows[0].time.getTime());
|
||||
|
||||
// cleanup ... remove the env variable
|
||||
delete process.env.PGPASSFILE;
|
||||
// cleanup ... remove the env variable
|
||||
delete process.env.PGPASSFILE;
|
||||
|
||||
done();
|
||||
pg.end();
|
||||
}))
|
||||
}));
|
||||
done();
|
||||
pg.end();
|
||||
}))
|
||||
}));
|
||||
});
|
||||
|
||||
@ -15,11 +15,14 @@ var config = {
|
||||
ssl: true
|
||||
};
|
||||
|
||||
//connect & disconnect from heroku
|
||||
pg.connect(config, assert.success(function(client, done) {
|
||||
client.query('SELECT NOW() as time', assert.success(function(res) {
|
||||
assert(res.rows[0].time.getTime());
|
||||
done();
|
||||
pg.end();
|
||||
}))
|
||||
}));
|
||||
test('connection with config ssl = true', function() {
|
||||
//connect & disconnect from heroku
|
||||
pg.connect(config, assert.calls(function(err, client, done) {
|
||||
assert.isNull(err);
|
||||
client.query('SELECT NOW() as time', assert.success(function(res) {
|
||||
assert(res.rows[0].time.getTime());
|
||||
done();
|
||||
pg.end();
|
||||
}))
|
||||
}));
|
||||
});
|
||||
@ -133,9 +133,14 @@ assert.lengthIs = function(actual, expectedLength) {
|
||||
|
||||
var expect = function(callback, timeout) {
|
||||
var executed = false;
|
||||
timeout = timeout || parseInt(process.env.TEST_TIMEOUT) || 5000;
|
||||
var id = setTimeout(function() {
|
||||
assert.ok(executed, "Expected execution of function to be fired");
|
||||
}, timeout || 5000)
|
||||
assert.ok(executed,
|
||||
"Expected execution of function to be fired within " + timeout
|
||||
+ " milliseconds " +
|
||||
+ " (hint: export TEST_TIMEOUT=<timeout in milliseconds>"
|
||||
+ " to change timeout globally)");
|
||||
}, timeout)
|
||||
|
||||
if(callback.length < 3) {
|
||||
return function(err, queryResult) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user