Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
onurtemizkan committed Dec 5, 2024
1 parent e6af97b commit 8ea56bd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const CONFIG = {
? parseInt(process.env.POSTGRES_PORT, 10)
: 54320,
maxClient: 1,
idleTimeoutMillis: 30000,
idleTimeoutMillis: 10000,
};

const DEFAULT_PGPOOL_ATTRIBUTES = {
Expand Down Expand Up @@ -125,7 +125,7 @@ describe('pg-pool', () => {
const testPostgresLocally = process.env.RUN_POSTGRES_TESTS_LOCAL; // For local: spins up local postgres db via docker
const shouldTest = testPostgres || testPostgresLocally; // Skips these tests if false (default)

before(function (done) {
before(function () {
const skip = () => {
// this.skip() workaround
// https://github.com/mochajs/mocha/issues/2683#issuecomment-375629901
Expand All @@ -150,7 +150,6 @@ describe('pg-pool', () => {

const pgPool = require('pg-pool');
pool = new pgPool(CONFIG);
setTimeout(done, 3000);
});

after(done => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('pg ESM usage', () => {
const testPostgresLocally = process.env.RUN_POSTGRES_TESTS_LOCAL; // For local: spins up local postgres db via docker
const shouldTest = testPostgres || testPostgresLocally; // Skips these tests if false (default)

before(async function () {
before(function () {
const skip = () => {
// this.skip() workaround
// https://github.com/mochajs/mocha/issues/2683#issuecomment-375629901
Expand All @@ -38,7 +38,7 @@ describe('pg ESM usage', () => {
}
});

after(async () => {
after(() => {
if (testPostgresLocally) {
testUtils.cleanUpDocker('postgres');
}
Expand All @@ -53,7 +53,7 @@ describe('pg ESM usage', () => {
'--experimental-loader=@opentelemetry/instrumentation/hook.mjs',
NODE_NO_WARNINGS: '1',
},
checkResult: err => {
checkResult: (err, stdout, stderr) => {
assert.ifError(err);
},
checkCollector: (collector: testUtils.TestCollector) => {
Expand Down
4 changes: 0 additions & 4 deletions plugins/node/opentelemetry-instrumentation-pg/test/pg.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,10 @@ describe('pg', () => {
postgres = require('pg');
client = new postgres.Client(CONFIG);

await new Promise<void>(resolve => setTimeout(resolve, 3000));

await client.connect();
});

after(async () => {
await new Promise<void>(resolve => setTimeout(resolve, 3000));

if (testPostgresLocally) {
testUtils.cleanUpDocker('postgres');
}
Expand Down

0 comments on commit 8ea56bd

Please sign in to comment.