Skip to content

Commit

Permalink
test: skip a test failing because of node-postgres bug. @see brianc/n…
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Feb 12, 2020
1 parent b1bf768 commit 447a373
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions test/slonik/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -649,25 +649,30 @@ test('idle transactions are terminated after `idleInTransactionSessionTimeout`',
t.true(error instanceof BackendTerminatedError);
});

test('statements are cancelled after `statementTimeout`', async (t) => {
t.timeout(5000);
if (pgNativeBindingsAreAvailable) {
// Skipping test because of a bug in node-postgres.
// @see https://github.com/brianc/node-postgres/issues/2103
} else {
test('statements are cancelled after `statementTimeout`', async (t) => {
t.timeout(5000);

const pool = createPool(TEST_DSN, {
maximumPoolSize: 5,
statementTimeout: 1000,
});
const pool = createPool(TEST_DSN, {
maximumPoolSize: 5,
statementTimeout: 1000,
});

t.deepEqual(pool.getPoolState(), {
activeConnectionCount: 0,
ended: false,
idleConnectionCount: 0,
waitingClientCount: 0,
});
t.deepEqual(pool.getPoolState(), {
activeConnectionCount: 0,
ended: false,
idleConnectionCount: 0,
waitingClientCount: 0,
});

const error = await t.throwsAsync(pool.query(sql`SELECT pg_sleep(2000)`));
const error = await t.throwsAsync(pool.query(sql`SELECT pg_sleep(2000)`));

t.true(error instanceof StatementTimeoutError);
});
t.true(error instanceof StatementTimeoutError);
});
}

test('retries failing transactions (deadlock)', async (t) => {
t.timeout(2000);
Expand Down

0 comments on commit 447a373

Please sign in to comment.