[pr-tests] darner-gpu's tests no longer stand still: refresh_tests::submission takes the two test locks in the order the tests beside it do #224
Loading…
Reference in a new issue
No description provided.
Delete branch "blazecoding2009/Darner:pr/test-lock-order"
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?
Contributor role (optional)
What it changes
The problem on main: gate 3 (
cargo test --workspace --locked) can stand still indarner-gpu's unit tests and never end. Onf3840d7it did in 1 of 6 runs of that test binary here, and in 4 of 5 runs ofhost::refresh_testsalone. What one such run printed before I stopped it:Two test locks are taken in opposite orders.
refresh_tests::submissiontakesone_submission's lock and thenwatch::one_view_test's (the second since6ecada3). Six tests of the same module takeone_view_test's first andone_submission's second:a_title_write_flushes_only_the_copies_it_writes,a_title_write_flushes_copies_of_its_pages_at_other_addresses,scoped_title_writes_end_as_writes_that_flush_everything,chunked_nothing_new_with_matches_individual,refresh_front_zero_arc_matches_and_runs_dueandframe_of_refresh_front. When a test that callssubmissionholding neither lock runs beside one of those six, each can hold one lock and wait for the other. Every other test that takes either lock (in a whole run, those ofwatch::andhost::watch_pipetoo) then waits behind them.submissionnow takesone_view_test's lock first, as those six tests do. Both locks are held over the same lines as before. Test code only: one function inmod refresh_testsofhost.rs.How it was tested
Tested revision:
27c1b18(this one commit onmainf3840d7).Commands and results:
cargo test --locked -p darner-gpu --lib --no-runon each revision, then that test binary run by itself, with a time limit a run (a whole run takes 27 to 48 s here, the module alone 2 s).f3840d7)27c1b18)host::refresh_testsalone, 90 s limit: runsThe one test that failed, in all six of those runs on either side, is
watch::tests::ask_once_by_res_splits_reservations_without_refusals. This change does not touch it and I did not look into it here.Changes a default: no.
Gates run on that revision (the three in AGENTS.md; there is no CI):
cargo clippy --workspace --all-targets --locked -- -D warnings: passed. The same with--all-features: passed.cargo xtask policy: 555 files ok.cargo test --workspace --locked: not run as one command on this revision. Of it, I randarner-gpu's tests as in the table. Onf3840d7plus another one-file change of mine (ramtrim.rsonly),cargo test --workspace --locked --no-fail-fastpassed in every other test binary butdarner-shader's (557 passed, 1 failed:emit::waterfall_tests::sampled_marks_restore_early_depth_only_when_safe_in_pixel_shaders, the failure #186 and #163 report onmain), and that is the run in whichdarner-gpu's tests first stood still.Gameplay: not run in the game. The change is in test code only.
Shader wave sizes tested, when relevant: not relevant.
Hardware dependence: likely general (a lock order). How often two such tests meet depends on timing and on the number of test threads: 16 here (Ryzen 7 8845HS, Windows 11 build 26300).
Coverage gaps: one PC. The cause is read from the code and from which tests waited, not from a dump of the waiting threads; the runs with the lock order changed are the evidence for it.
Checklist
main.docs/asset-policy.md.Checked for overlap
one_view_test,one_submission,deadlockandtest hangfound no report. I searched the diff of every open pull request (83): 31 changehost.rs, none changessubmissionorone_submission. #50 adds a test in another file that takesone_view_test's lock alone, which this order does not affect.This change was made with AI assistance (Claude Code).
🤖 Generated with Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.