Skip to content

Fix the rerunner teardown test failing on main - #116

Closed
DavertMik wants to merge 1 commit into
mainfrom
fix/codeceptjs-container-mock-leak
Closed

Fix the rerunner teardown test failing on main#116
DavertMik wants to merge 1 commit into
mainfrom
fix/codeceptjs-container-mock-leak

Conversation

@DavertMik

Copy link
Copy Markdown
Contributor

main has been red since #112, and every PR inherits the failure:

(fail) Rerunner healing plugin wiring > wires process-wide handlers only once across repeated setup/teardown cycles
 939 pass  1 fail

What is happening

tests/unit/explorer.test.ts calls mock.module('codeceptjs', …). Bun applies that mock to the subpath codeceptjs/lib/container too, and module mocks outlive the file that declared them — the whole tests/unit run shares one process, so every later file importing Container gets the fake object:

PROBE: STANDARD_ACTING_HELPERS = undefined
PROBE: Container is class? object [ "create", "helpers", "support", "started" ]
PROBE: aiTrace threw -> undefined is not an object (evaluating 'supportedHelpers')

codeceptjs/lib/plugin/aiTrace.js caches the list in a module-level const:

const supportedHelpers = Container.STANDARD_ACTING_HELPERS

With the fake container that is undefined, so its for…of throws inside Rerunner.setupPlugins() — before the healing handlers are registered. The test counts zero step.after registrations and fails.

That is why it passes on its own and fails in the suite: explorer sorts before rerunner-healing-teardown.

The fix

Give the fake container the static that codeceptjs reads at import time. aiTrace then finds no matching helper, warns, disables itself, and setupPlugins() gets to the healing wiring as it does in production.

bun test tests/unit → 940 pass, 0 fail.

🤖 Generated with Claude Code

explorer.test.ts mocks the codeceptjs module. Bun applies that mock to
`codeceptjs/lib/container` as well and keeps it for the rest of the run,
so every later test file importing Container gets the fake object.

aiTrace.js caches `Container.STANDARD_ACTING_HELPERS` in a module-level
const, which was then undefined, and its for-of threw inside
Rerunner.setupPlugins() — so the healing wiring test saw zero step.after
registrations and failed. It passed in isolation and failed in the suite,
because explorer.test.ts sorts before it.

Give the fake container the static codeceptjs reads at import time.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Explorbot Self-Regression

Commit 381962e · run

Scenario Result Attempts Duration
basic (native) FAIL 3/3 17m

Attempt details

  • basic (native) attempt 1 — FAIL: login evidence: PASS (post-login plan=true, post-login research=true); research: PASS (files=7, wellFormed=true, keywords=7/3); scenarios: PASS (tests=7/5, features=4/3); tests passed: FAIL (4 passed, 1 failed (reporter: 4 passed, 1 failed))
  • basic (native) attempt 2 — FAIL: login evidence: PASS (post-login plan=true, post-login research=true); research: PASS (files=6, wellFormed=true, keywords=7/3); scenarios: PASS (tests=5/5, features=4/3); tests passed: FAIL (4 passed, 1 failed (reporter: 4 passed, 1 failed))
  • basic (native) attempt 3 — FAIL: login evidence: PASS (post-login plan=true, post-login research=true); research: PASS (files=6, wellFormed=true, keywords=7/3); scenarios: PASS (tests=6/5, features=4/3); tests passed: FAIL (4 passed, 1 failed (reporter: 4 passed, 1 failed))

Session analysis — basic (native):

Session Analysis

The Issues list feature was explored across 5 tests. Core filtering operations (search, status, label) and detail view navigation all function correctly. The issue creation flow has an automation problem where form submission fails repeatedly, yet the issue still appears in the table causing row count mismatch.

Coverage

  • Pages: /issues, /issues?new=1, /issues/5
  • Features: Issue list display, search filtering, status filtering, label filtering, detail view navigation, issue creation

What works

  • Search filteringET-2 Filter issues by search keyword and verify filtered results
  • Status filteringET-3 Filter issues by status and verify filtered results
  • Label filteringET-4 Filter issues by label and verify results update
  • Detail view navigationET-5 Open issue detail view by clicking table row

Defects

No defects identified. All filtering flows work as expected.

UX issues

None identified.

Execution Issues

  • ET-1 Create new issue and verify it appears in list — form submission timed out or retried repeatedly; test shows title appeared but row count exceeded expected, indicating multiple submissions occurred during retry loops

@DavertMik

Copy link
Copy Markdown
Contributor Author

The regression job failed on ET-1 Create new issue and verify it appears in list — three attempts, each "form submission repeatedly failed / multiple Create button click failures before succeeding on retry". That job drives a real app with real models; the same job passed on #115 an hour earlier. This PR changes one line of a unit-test mock, so it cannot reach it.

test and integration are green, which is what this PR is about: main has been failing the rerunner teardown test since #112.

@DavertMik DavertMik closed this Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant