Repository navigation
omamobile-audio 0.5.5: the tests' state files are written atomically - #107
Conversation
…atomically The watchdog's jump test changes a control from a background job while the watchdog reads the fake mixer's state file, and CI once caught the read halfway through the write (JSONDecodeError, the test failed). Both fakes now write a temporary file and rename it over the state.
The flake had a second writer: JsonCtl, the json: control backend the tests run the speaker code against, rewrites the fake mixer's state on every heartbeat read, in place. The fake mixer reading at that moment saw an empty file. JsonCtl now writes a temporary file and renames it, as the fakes do. Nothing changes on the palmtop: JsonCtl is used only with OMAMOBILE_CTL_BACKEND=json:.
…s first reading The jump tests changed the estimate 0.4 s after starting the watchdog. On a slow CI runner the watchdog wasn't reading yet, took the raised value as its baseline, saw no jump and didn't mute. The jump now waits for the watchdog's start line and a few intervals, and the watchdog runs 60 iterations.
|
Third commit: with the decode errors gone, the jump test still failed once on CI for a timing reason. It changed the temperature 0.4 s after starting the watchdog, and a slow runner's watchdog took the raised value as its baseline. The jump now waits for the watchdog's start line and a few intervals. CI is green here and on #100 and #101, which carry the same commits. Under a much heavier load than CI (two busy loops per core) one other timing test, |
|
Thanks for tracking this down, @W4HO-ham. Two writers, both fixed with a rename, and a jump test that waits for the watchdog's first reading instead of a fixed 0.4 s: that's the right fix, and it explains every red run we've had on that test. I checked that One thing on my side: my unmerged |
… rounds L-348 to L-361: shared drivers judged against every int-line user (#150), board pins against every stock user (#151), ownership flags under the consumer's lock (#152), /chosen children and Google's panel constants (#154), same-day notes PRs on one device (#208/#209), merge simulations for DEVICES rows, ours included (#165), stacked PRs that merged main (#115/#117), titles behind renumbered versions, a contributor merge that dropped the PR (#99), smoke package lists as provenance and "owner-authorized" writes (#200), promised fixes and named tags checked on the remote (#153/#157/#158), and file swaps into old packages (#193). C-23 (usbc-deadman's device scope, kernel #107) and C-24 (BNEP in a lynx-only fragment, #98). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… rounds L-348 to L-361: shared drivers judged against every int-line user (derekross#150), board pins against every stock user (derekross#151), ownership flags under the consumer's lock (derekross#152), /chosen children and Google's panel constants (derekross#154), same-day notes PRs on one device (derekross#208/derekross#209), merge simulations for DEVICES rows, ours included (derekross#165), stacked PRs that merged main (derekross#115/derekross#117), titles behind renumbered versions, a contributor merge that dropped the PR (derekross#99), smoke package lists as provenance and "owner-authorized" writes (derekross#200), promised fixes and named tags checked on the remote (derekross#153/derekross#157/derekross#158), and file swaps into old packages (derekross#193). C-23 (usbc-deadman's device scope, kernel derekross#107) and C-24 (BNEP in a lynx-only fragment, derekross#98). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI failed several times tonight on unrelated branches (omarchy-mobile #100, #101, and this one's first push) in the watchdog's temperature-jump tests, with a
JSONDecodeErrorfrom the fake mixer: a read of its state file landed mid-write and saw an empty file.There were two writers. The fake mixer and fake PipeWire rewrote their state in place, and so did
JsonCtl, thejson:control backend the tests run the speaker code against, on every heartbeat read (the watchdog reads the heartbeat constantly). All three now write a temporary file and rename it over the state, so a reader sees the old file or the new one, never half of one.Nothing changes on the palmtop:
JsonCtlis used only withOMAMOBILE_CTL_BACKEND=json:. The version goes to 0.5.5 becauselib/speaker_dsp.pyships in the package.test/allpasses three times in a row locally andtools/pr-checkis clean. The same two commits are on #100 and #101 so their CI can pass; whichever lands first, the others merge clean.