test: the release scripts' stand-in gh is safe when two calls run at once (flaky JSONDecodeError) #2130
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!2130
Loading…
Reference in a new issue
No description provided.
Delete branch "test/fake-gh-atomic"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
tests/test_release_scripts.pyfails now and then on Linux, as it did on main at364d1994and on #2127. The failing test istest_tag_pushed_by_hand_gets_its_release_and_sums; the stand-inghhitsjson.decoder.JSONDecodeError: Expecting value: line 1 column 1when it reads its state file.The cause:
scripts/release_files.sh checkruns twoghcalls at the same time (cmp -s <(sums "$id") <(uploaded "$id")). Every stand-in call appends itself tocallsand rewrites the state file withopen(STATE, "w"). So one call can read the file while the other has just truncated it.The stand-in now:
fcntllock for the whole call, so calls take turns and no entry incallsis lost;os.replace.The test is the only thing changed; the release scripts stay as they are. It needs
jqand only runs on Linux, so this was not run locally; CI checks it.🤖 Generated with Claude Code
github-sync referenced this pull request2026-11-12 06:22:54 +00:00