Conversation
There was a problem hiding this comment.
Pull request overview
Pins Mocha to a fixed patch version to stabilize the test runner behavior in CI (addressing the reported ERR_MOCHA_MULTIPLE_DONE/timeout interaction during afterEach cleanup).
Changes:
- Pin
mochadevDependency to11.7.5(remove^range) inpackage.json. - Update
package-lock.jsonto lock Mocha to11.7.5(including the resolved tarball/integrity), avoiding11.7.6.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| package.json | Pins Mocha version to prevent patch-level drift in CI. |
| package-lock.json | Updates the lockfile to ensure Mocha resolves to 11.7.5 consistently. |
rjdew-progress
approved these changes
Jun 30, 2026
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.
Pin Mocha to 11.7.5 to resolve
ERR_MOCHA_MULTIPLE_DONEcrash in transformAll testsProblem
The test-complete suite was producing 16 test failures in Jenkins for two test files:
Every affected test showed
done() called multiple timeswith this pattern:All individual test assertions were actually passing (Mocha reported
N passing), but the Mocha runner crashed post-suite with exit code 7, causing Jenkins to report the entire file as failed.The crash originated in the
afterEachhook, which callsdocuments.remove(uris)to clean up 100 documents after each test. On slower environments (Jenkins), this operation occasionally exceeds the hook's 20-second timeout. When the timeout fires, Mocha callsdone()with the timeout error; whenremove()eventually completes, it callsdone()a second time, triggeringERR_MOCHA_MULTIPLE_DONEand crashing the process.Fix
Pinning Mocha to 11.7.5 resolves the crash. This version handles the
ERR_MOCHA_MULTIPLE_DONEedge case without terminating the process, allowing the suite to exit cleanly (exit code 0). No changes to test source files were required.Verification
All three previously failing test files were re-run locally against
marklogic-server-ubi:11.3.20260630-ubi-2.2.5after the upgrade:Note: This issue started as a result of this PR: #1085