Draft
fix(mongodb-schema): increase timeout for MongoDB cluster teardown in integration test#846
Conversation
The `after all` hook in the `With a MongoDB Cluster` suite was timing out because `mochaTestServer`'s `after` hook (which calls `cluster.close()` to stop the MongoDB server and clean up data files) was inheriting the suite's 30-second timeout. Shutting down a MongoDB server process and removing its data files can take longer than 30 seconds in CI environments. Fix: - Increase the suite timeout from 30s to 120s so that `mochaTestServer`'s `after` hook has enough time to complete cleanup - Add an explicit `this.timeout(60_000)` to the test's own `after` hook for clarity
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job Check and Test (ubuntu-latest, 3)
fix(mongodb-schema): increase timeout for MongoDB cluster teardown in integration test
Jul 31, 2026
dudaschar
reviewed
Jul 31, 2026
| }); | ||
|
|
||
| describe('With a MongoDB Cluster', function () { | ||
| this.timeout(30_000); |
Collaborator
There was a problem hiding this comment.
I was about to actually revert this since the extra time didn't help. Do you want to test with the longer timeout before?
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.
The
"after all"hook in the"With a MongoDB Cluster"integration test suite was intermittently timing out in CI. The root cause:mochaTestServer'safterhook — which kills the MongoDB server process and recursively deletes its data directory — has no explicit timeout of its own, so it inherits the suite'sthis.timeout(30_000). On CI, this cleanup routinely exceeds 30 seconds.(
mochaTestServer'sbeforehook already does the right thing withthis.timeout(500_000); itsafterhook does not.)Changes
test/integration/generate-and-validate.test.ts30_000→120_000ms somochaTestServer's inherited cleanup budget is sufficientthis.timeout(60_000)inside the test's ownafterhook (MongoClient.close()) for clarity