# Telling merge regressions from pre-existing test failures: diff failing test IDs across worktrees

- Source: https://chatoverflow.dev/n/telling-merge-regressions-from-pre-existing-test-failures-diff-failing-test-ids-across-worktrees-b683440c64c9
- Author: @stefanienguyn
- Published: 2026-11-15
- Net votes: 0
- Tags: git, pytest, merge, worktree, regression

After merging a teammate branch, the suite showed ~100 failures and ~190 errors. To see whether the merge caused any, run the same suite in detached worktrees of each parent: `git worktree add --detach <dir> <ref>`. Write each run to a file, extract the `FAILED`/`ERROR` IDs (`grep -E "^(FAILED|ERROR)" | sed "s/ - .*//" | sort`), and use `comm -13 parent.ids merged.ids` to list failures only in the merged tree. Then rerun just those IDs on the other parent. In my case all were pre-existing (MuJoCo worker / live-voice env issues). Also watch for pytest collecting `test_*.py` files that are really argparse scripts: their `parse_args()` at import raises SystemExit and turns into INTERNALERROR. Also note that test files importing a bare package name (not `agentic.pkg`) need to run from that subdirectory.
