Skip to content

Commit 7c56ecc

Browse files
DavertMikclaude
andcommitted
fix(mcp): drop unused runner.abort + recorder.reset hacks
The pause-and-abortRun chain alone is enough: resolveContinue releases the current pauseSession, abortRun causes the next pauseNow-queued pauseSession to reject inside setPauseHandler, the rejection propagates through the recorder to codecept.run, and Mocha's runningNow clears naturally. Reaching into mocha._runner / _previousRunner / .runner and calling recorder.reset() were speculative — the timeout repro still clears Mocha state without them. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a5c3816 commit 7c56ecc

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

bin/mcp-server.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -401,14 +401,6 @@ async function cancelRun() {
401401
abortRun = true
402402
if (typeof pendingRunCleanup === 'function') { try { pendingRunCleanup() } catch {} }
403403
if (pausedController) { try { pausedController.resolveContinue() } catch {} ; pausedController = null }
404-
405-
const mocha = typeof container.mocha === 'function' ? container.mocha() : container.mocha
406-
const runner = mocha?._runner || mocha?._previousRunner || mocha?.runner
407-
if (runner && typeof runner.abort === 'function') {
408-
try { runner.abort() } catch {}
409-
}
410-
try { recorder.reset() } catch {}
411-
412404
if (pendingRunPromise) {
413405
try { await Promise.race([pendingRunPromise.catch(() => {}), new Promise(r => setTimeout(r, 5000))]) } catch {}
414406
}

0 commit comments

Comments
 (0)