test(scheduler): give each suite its own db schema and close its pool (NAN-6500) - #6988
Open
agusayerza wants to merge 1 commit into
Open
test(scheduler): give each suite its own db schema and close its pool (NAN-6500)#6988agusayerza wants to merge 1 commit into
agusayerza wants to merge 1 commit into
Conversation
… (NAN-6500) `getTestDbClient` hardcoded `schema: 'scheduler'` so all 10 call sites shared one schema. `clearDatabase()` runs `DROP SCHEMA CASCADE`, so a teardown in one file dropped the schema another was still using, which is where the `Invalid state transition` and `expected +0 to be 1` failures came from. Each suite now passes its own. None of them closed their knex pool either. `DatabaseClient.destroy()` existed but was never called, and four suites had no `afterAll` at all. At `poolMax: 50` per client, nine live clients in one process exhaust Postgres and unrelated suites start failing with `Failed to authenticate user`. With both fixed these suites no longer need their own process.
agusayerza
marked this pull request as ready for review
July 31, 2026 19:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
getTestDbClienthardcodedschema: 'scheduler', so all 10 call sites shared one schema.clearDatabase()runsDROP SCHEMA CASCADE, so a teardown in one file dropped the schema another was still using. That is where theInvalid state transitionandexpected +0 to be 1failures came from. Each suite now passes its own.None of these suites closed their knex pool either.
DatabaseClient.destroy()existed but was never called, and four had noafterAllat all. AtpoolMax: 50per client, nine live clients in one process exhaust Postgres and unrelated suites start failing withFailed to authenticate user.With both fixed they no longer need their own process, so
needsOwnProcessis back to just thevi.mockscan.Related to NAN-6488.