File tree Expand file tree Collapse file tree 4 files changed +5
-11
lines changed
plugins/node/opentelemetry-instrumentation-pg/test Expand file tree Collapse file tree 4 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,6 @@ import pg from 'pg';
4343
4444const client = new pg . Client ( CONFIG ) ;
4545
46- await new Promise ( resolve => setTimeout ( resolve , 4000 ) ) ;
4746await client . connect ( ) ;
4847
4948const tracer = trace . getTracer ( ) ;
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ const CONFIG = {
6868 ? parseInt ( process . env . POSTGRES_PORT , 10 )
6969 : 54320 ,
7070 maxClient : 1 ,
71- idleTimeoutMillis : 30000 ,
71+ idleTimeoutMillis : 10000 ,
7272} ;
7373
7474const DEFAULT_PGPOOL_ATTRIBUTES = {
@@ -125,7 +125,7 @@ describe('pg-pool', () => {
125125 const testPostgresLocally = process . env . RUN_POSTGRES_TESTS_LOCAL ; // For local: spins up local postgres db via docker
126126 const shouldTest = testPostgres || testPostgresLocally ; // Skips these tests if false (default)
127127
128- before ( function ( done ) {
128+ before ( function ( ) {
129129 const skip = ( ) => {
130130 // this.skip() workaround
131131 // https://github.com/mochajs/mocha/issues/2683#issuecomment-375629901
@@ -150,7 +150,6 @@ describe('pg-pool', () => {
150150
151151 const pgPool = require ( 'pg-pool' ) ;
152152 pool = new pgPool ( CONFIG ) ;
153- setTimeout ( done , 3000 ) ;
154153 } ) ;
155154
156155 after ( done => {
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ describe('pg ESM usage', () => {
2121 const testPostgresLocally = process . env . RUN_POSTGRES_TESTS_LOCAL ; // For local: spins up local postgres db via docker
2222 const shouldTest = testPostgres || testPostgresLocally ; // Skips these tests if false (default)
2323
24- before ( async function ( ) {
24+ before ( function ( ) {
2525 const skip = ( ) => {
2626 // this.skip() workaround
2727 // https://github.com/mochajs/mocha/issues/2683#issuecomment-375629901
@@ -38,7 +38,7 @@ describe('pg ESM usage', () => {
3838 }
3939 } ) ;
4040
41- after ( async ( ) => {
41+ after ( ( ) => {
4242 if ( testPostgresLocally ) {
4343 testUtils . cleanUpDocker ( 'postgres' ) ;
4444 }
@@ -53,7 +53,7 @@ describe('pg ESM usage', () => {
5353 '--experimental-loader=@opentelemetry/instrumentation/hook.mjs' ,
5454 NODE_NO_WARNINGS : '1' ,
5555 } ,
56- checkResult : err => {
56+ checkResult : ( err , stdout , stderr ) => {
5757 assert . ifError ( err ) ;
5858 } ,
5959 checkCollector : ( collector : testUtils . TestCollector ) => {
Original file line number Diff line number Diff line change @@ -153,14 +153,10 @@ describe('pg', () => {
153153 postgres = require ( 'pg' ) ;
154154 client = new postgres . Client ( CONFIG ) ;
155155
156- await new Promise < void > ( resolve => setTimeout ( resolve , 3000 ) ) ;
157-
158156 await client . connect ( ) ;
159157 } ) ;
160158
161159 after ( async ( ) => {
162- await new Promise < void > ( resolve => setTimeout ( resolve , 3000 ) ) ;
163-
164160 if ( testPostgresLocally ) {
165161 testUtils . cleanUpDocker ( 'postgres' ) ;
166162 }
You can’t perform that action at this time.
0 commit comments