node-postgres icon indicating copy to clipboard operation
node-postgres copied to clipboard

[pg-cursor] Add query_timeout parameter to test code to trigger queryCallback bug

Open adam-nielsen opened this issue 3 years ago • 6 comments

There is a bug in the query callback handling (e.g. #1860 #2560) but the test code doesn't pick it up. This change ensures that code path runs in the tests, so it will probably make the tests fail until the bug is fixed. (I say 'probably' because the exception doesn't get thrown until after all the tests have completed successfully.)

node-postgres/packages/pg-cursor/node_modules/mocha/lib/runner.js:911
    throw err;                                                               
    ^                                                                        
                                                                             
TypeError: queryCallback is not a function                                   
    at Timeout._onTimeout (node-postgres/packages/pg-cursor/node_modules/pg/lib/client.js:532:9)
    at listOnTimeout (node:internal/timers:557:17)                           
    at processTimers (node:internal/timers:500:7)

adam-nielsen avatar Dec 01 '21 01:12 adam-nielsen

The weird thing is github actions isn't running on this PR. :( I might not have added the right thing to it to run on a pull or something...I'll have to look into that.

brianc avatar Dec 10 '21 16:12 brianc

Thanks for this btw! And sorry for the delay: was out of town until last night.

brianc avatar Dec 10 '21 16:12 brianc

@brianc you must add on: [push, pull_request] to the ci.yml config file to run on a PR ^^

darkgl0w avatar Dec 10 '21 17:12 darkgl0w

@brianc you must add on: [push, pull_request] to the ci.yml config file to run on a PR ^^

roger, wilco!

brianc avatar Dec 10 '21 17:12 brianc

@brianc is there any solution to this bug?

avivshafir avatar May 10 '22 05:05 avivshafir

@brianc, Please provide ETA for this fix - to prevent Fatal exception using "query_timeout" with queryStream.

yaverin avatar Jul 05 '22 19:07 yaverin