Skip to content

Pins the crash report wait with a slow crash - #286

Merged
johnnyt merged 1 commit into
mainfrom
se-4426-crash-report-wait
Nov 28, 2026
Merged

johnnyt merged 1 commit into
mainfrom
se-4426-crash-report-wait

Conversation

@johnnyt

@johnnyt johnnyt commented Nov 28, 2026

Copy link
Copy Markdown
Member

What

The screen editor page's crash report tests wait for the crashing process to exit (a bounded monitor wait in wait_for_crash_report/1) before they read the captured log. No test failed when that wait was dropped, because a real page crash logs its report too fast to race.

Acceptance branch taken

The first branch: a test that fails when the wait is removed. A new test, "the wait holds the capture open for a report that is logged late", starts a process whose terminate/2 sleeps. terminate/2 runs before the crash report is logged, so the report lands late on demand. The test asserts the report is in the capture after wait_for_crash_report/1 returns.

Sabotage

Scope: the helper's body. Mutation: wait_for_crash_report/1 returns without waiting (a stand-in :DOWN message is sent to the test process). The diff against the saved copy was non-empty, and the new test failed on its =~ assertion for the crash report line. The other crash report tests still passed under the same mutation, which is why the helper's comment now says plainly that the calls inside those tests are not each pinned: a dropped call there stays a robustness measure that no test can discriminate. The file was restored byte-equal from the copy.

Verification

  • Full mix quality green on the branch (format, compile, credo, dialyzer, tests with coverage).
  • Test-only change; no library code, dependency or lockfile change. Behaviour read against riddler as resolved by the lockfile at 0.9.0, though this change touches no riddler call.

Provenance

Engineering choice: pin the helper with a slow crash rather than only documenting the limit; the helper comment carries the part no test can pin.

The screen editor page's crash report tests wait for the crashing
process to exit before they read the capture, but none of them could
tell if the wait was dropped: a real page crash logs its report too
fast to race.

A new test crashes a process that sleeps in terminate/2, which runs
before the report is logged, so the report lands late on demand. It
fails when wait_for_crash_report/1 returns without waiting; that
mutation was run and turned the test red on its assertion.

The helper's comment says the calls in the other tests are not each
pinned, since a real page crash cannot be slowed.

Refs: se-4426
@johnnyt
johnnyt merged commit ab105fa into main Nov 28, 2026
4 checks passed
@johnnyt
johnnyt deleted the se-4426-crash-report-wait branch November 28, 2026 13:44
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