Symptoms
Test TestRoundtrip_AnchorLineDeleted_Outdated in roundtrip_integration_test.go (build tag e2e_github):
- Passes when run in isolation:
./scripts/e2e-roundtrip.sh -run TestRoundtrip_AnchorLineDeleted_Outdated -v
- Fails with HTTP 422 from
gh api (on the second crit push) when run as part of the full suite via make e2e-roundtrip.
Observed at least twice in CI runs against the sandbox PR. Re-running the test in isolation passes cleanly.
Likely cause
Each scenario gets its own throwaway branch + PR via newRoundtripEnv, so cross-test PR pollution is unlikely. More plausible:
- The sandbox repo accumulates rapid-fire PR-create + close + delete-branch operations during the suite. The 422 may be GitHub catching up with branch deletion or PR state when this scenario tries to resync after its own force-push.
- Race between
gh pr close --delete-branch cleanup from a prior test and this test's force-push + add-comment.
Repro
export CRIT_ROUNDTRIP_REPO=crit-md/crit-roundtrip-sandbox
make e2e-roundtrip
# Observe TestRoundtrip_AnchorLineDeleted_Outdated FAIL with HTTP 422 on the second push
./scripts/e2e-roundtrip.sh -run TestRoundtrip_AnchorLineDeleted_Outdated -v
# Passes on its own
Suggested investigation
- Add a short
gh api repos/{slug}/pulls/{N} poll after the force-push to confirm GitHub recomputed the diff before the second crit push fires.
- Or stagger scenarios:
t.Parallel() is already implicit-off; consider an explicit time.Sleep(2*time.Second) after the force-push as a temporary mitigation while the underlying race is investigated.
Source
Surfaced during the body-hash refactor on PR #445.
Symptoms
Test
TestRoundtrip_AnchorLineDeleted_Outdatedinroundtrip_integration_test.go(build tage2e_github):./scripts/e2e-roundtrip.sh -run TestRoundtrip_AnchorLineDeleted_Outdated -vgh api(on the secondcrit push) when run as part of the full suite viamake e2e-roundtrip.Observed at least twice in CI runs against the sandbox PR. Re-running the test in isolation passes cleanly.
Likely cause
Each scenario gets its own throwaway branch + PR via
newRoundtripEnv, so cross-test PR pollution is unlikely. More plausible:gh pr close --delete-branchcleanup from a prior test and this test's force-push + add-comment.Repro
Suggested investigation
gh api repos/{slug}/pulls/{N}poll after the force-push to confirm GitHub recomputed the diff before the secondcrit pushfires.t.Parallel()is already implicit-off; consider an explicittime.Sleep(2*time.Second)after the force-push as a temporary mitigation while the underlying race is investigated.Source
Surfaced during the body-hash refactor on PR #445.