Pin the Crash in a Characterization Test Before You Patch Upstream
说明与用途
该工作流程展示了如何在修改生产代码之前,在测试中捕获崩溃,以便维护者能够重现并验证修复。
问题
First‑time contributors often submit patches that only show a successful path, leaving the original crash undocumented and hard for maintainers to reproduce.
结果
The workflow ensures that the original crash is captured as an executable oracle, making it easy for maintainers to reproduce and verify the fix, and preventing regressions.
工作流
- Clone the repository and reproduce the crash locally.
- Write a test that records the current crash behavior (e.g., non‑zero exit, exception message).
- Commit the test to a branch that still matches upstream main without modifying production code.
- Create a helper script to run the test on main and on the patched commit, showing the pass/fail flip.
- Add labels (oracle-before / oracle-after) in the PR body to document the change.
- Include a CSV grid comparing crash status across release tags, main, and the patched commit.
- Submit the PR with the test and helper scripts attached, ensuring reviewers can replay the failure.
证据
The pull request still stalled because maintainers could not replay the old failure against the new tree.
A useful oracle fails on the unpatched tree and passes on the patched commit for one named input.
- 记录日期: 2026-09-21T12:00:26.308Z