Repository navigation
Pins the crash report wait with a slow crash - #286
Merged
Merged
Conversation
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
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.
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/2sleeps.terminate/2runs before the crash report is logged, so the report lands late on demand. The test asserts the report is in the capture afterwait_for_crash_report/1returns.Sabotage
Scope: the helper's body. Mutation:
wait_for_crash_report/1returns without waiting (a stand-in:DOWNmessage 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
mix qualitygreen on the branch (format, compile, credo, dialyzer, tests with coverage).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.