-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cause jest integration tests to play nicely with tinypg/pg.pool on connection errors #53
Comments
It may actually be a supertest issue, not so much tinypg nor jest or pg.pool: |
One thing that seemed to help a bit was putting |
Explicitly getting a client and doing |
Jest still thinks we are leaking memory, though:
|
This seems to help integration tests finish properly when there are failures related to database setup or tear-down. Issue #53 Cause jest integration tests to play nicely with tinypg
There might be other issues but the main issue as described in the original post above is resolved for now. |
Expected behavior:
An error (such as failure to connect) during an integration test causes that test to fail shortly after the error, whether that occurs in a
before
section of the test or the test itself.Actual behavior:
Timeouts occur as well as "open handles potentially keeping Jest form exiting."
Example debug logs from a draft
opportunities.int.test.ts
:The key spot seems to be this:
The seven second hang occurs there, and there is no mention of the
dropSchema
finishing that query, nor is there any error logged, here is the relevant code fromharnessFunctions
:I would expect to see a warn mesage or the error itself long before a timeout here.
Here is the
beforeEach
call inopportunities.int.test
:The text was updated successfully, but these errors were encountered: