You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Flaky test: find_similar::stopping_leaves_the_view_alone_and_the_next_search_reads_only_the_rest counts 10 or 11 reads of 12 under load #3823
tests::find_similar::stopping_leaves_the_view_alone_and_the_next_search_reads_only_the_rest (crates/ui-egui/src/tests/find_similar.rs) fails now and then under a full parallel cargo xtask ci run:
Seen locally on macOS (Apple M3 Max) in full CI runs of #1181 (head 77b295ba9) and #2102 (head 15d591951), and earlier today on unchanged main while checking another branch (10 or 11 reads of 12). #1181 changes only docs and a Python tool, so its code is the same as main's. Run alone, the test passed 5 of 5 times on main 5b4eb6924.
A guess, not checked: line 164 counts the drive's reads right after until_done. If until_done gives up after its time limit on a loaded machine, or the activity row clears before the last reads are counted, the count can be short. Waiting on the read count itself (as line 152 already does with step_until) before asserting would remove the race.
Per AGENTS.md (flaky tests), it has failed on two unrelated branches here, so it qualifies for #[ignore = "flaky: #<this issue>"] in a PR of its own until it's fixed.
A second test in the same file looks like the same kind of race: tests::find_similar::a_search_from_the_menu_reads_off_the_ui_thread_and_the_window_goes_on failed on the Windows gate of #1400 (run https://github.com/storytold/lightcraft/actions/runs/42076072804/job/127416553817) at crates/ui-egui/src/tests/find_similar.rs:109:5, left: 0, right: 12. #1400 does not touch Find Similar. crates/ui-egui/src/find_similar.rs:44 sets the progress row's total on the worker thread, so three frames after the search starts a slow runner can still show 0 of 12. Waiting for the total to be set (or stepping until it is) before the assert would make it deterministic.
Another occurrence on an unrelated branch: a full cargo xtask ci while preparing #3702, which doesn't touch Find Similar. The branch is main at 8a0b91a9 plus the #3702 Sky changes. The assertion is the same one, now at line 170, and this time 11 of 12 reads were counted:
test tests::find_similar::stopping_leaves_the_view_alone_and_the_next_search_reads_only_the_rest ... FAILED
thread 'tests::find_similar::stopping_leaves_the_view_alone_and_the_next_search_reads_only_the_rest' panicked at crates/ui-egui/src/tests/find_similar.rs:170:5:
assertion `left == right` failed
left: 11
right: 12
test result: FAILED. 1915 passed; 1 failed; 4 ignored; 0 measured; 0 filtered out; finished in 159.61s
Environment: macOS 27.0, Apple silicon, rustc 1.99.1. Run alone, the test then passed 3 of 3 times. I haven't tried #3824 against this.
Another occurrence while validating the main merge for #3757: main at e9c29e2c plus the persistent face-ignore branch (526d4c7a), with only a documentation conflict resolved. The failing test body and the Find Similar/search-cache/task implementation are unchanged from that main revision; this PR extends a different library-switch test in the same test file.
The full gate also reproduced the separate known #3788 legacy-render golden mismatch. I have not rerun this test until green, changed its assertion or quarantined it in the feature PR. The merge validation will explicitly disclose this failure and link this issue and the separate proposed fix #3824.
The existing #3824 explanation matches the code inspected here: similar::plan uses media.source_ref, which can return an already-loaded source, while this fixture counts only file-loader calls on search threads. This report adds the observed failure; it does not claim a new independent local run on bare main.
@gmrmad1, #3824 (Bruno-Alumn) already fixes this. lostwald re-checked it on current main today: it merges cleanly and the 11 find_similar tests pass. So a second PR may not be needed. A review on #3824 would help most.
Another occurrence: macOS 27.0.1 aarch64, rustc 1.99.0, cargo xtask ci --quick on #4349's branch (main at 2dcb258 plus Lens Blur changes; nothing in Find Similar), while another cargo test run was loading the machine. find_similar.rs:170: left 11, right 12. Run alone it passed three times out of three. Seems to support getting #3824 reviewed.
Observed the same failure on Linux x86_64 during local integration of #3268 and #3964 on main a349817 (Find Similar implementation and test unchanged):
The earlier full gate on the ComfyUI-only integration passed this test. Code inspection confirms that media.source_ref can return cached pixels populated by Detail/filmstrip rendering, so a completed search need not perform 12 file-loader calls. I am checking the existing test-only correction from #3824 locally rather than changing production search behavior or disabling the test.
Activity
ticket-craft commentedon Nov 5, 2026
Possibly related: #3799.
AlexChambers commentedon Nov 5, 2026
A second test in the same file looks like the same kind of race:
tests::find_similar::a_search_from_the_menu_reads_off_the_ui_thread_and_the_window_goes_onfailed on the Windows gate of #1400 (run https://github.com/storytold/lightcraft/actions/runs/42076072804/job/127416553817) atcrates/ui-egui/src/tests/find_similar.rs:109:5,left: 0, right: 12. #1400 does not touch Find Similar.crates/ui-egui/src/find_similar.rs:44sets the progress row's total on the worker thread, so three frames after the search starts a slow runner can still show 0 of 12. Waiting for the total to be set (or stepping until it is) before the assert would make it deterministic.jllubia commentedon Nov 7, 2026
Another occurrence on an unrelated branch: a full
cargo xtask ciwhile preparing #3702, which doesn't touch Find Similar. The branch ismainat8a0b91a9plus the #3702 Sky changes. The assertion is the same one, now at line 170, and this time 11 of 12 reads were counted:Environment: macOS 27.0, Apple silicon, rustc 1.99.1. Run alone, the test then passed 3 of 3 times. I haven't tried #3824 against this.
lostwald commentedon Nov 10, 2026
Another occurrence while validating the main merge for #3757:
mainate9c29e2cplus the persistent face-ignore branch (526d4c7a), with only a documentation conflict resolved. The failing test body and the Find Similar/search-cache/task implementation are unchanged from that main revision; this PR extends a different library-switch test in the same test file.macOS 27.2, Apple M2/Metal, Rust 1.95.0, default libtest runner,
CARGO_INCREMENTAL=0,CARGO_BUILD_JOBS=2,RUST_TEST_THREADS=2, craft-fonts configured:The full gate also reproduced the separate known #3788 legacy-render golden mismatch. I have not rerun this test until green, changed its assertion or quarantined it in the feature PR. The merge validation will explicitly disclose this failure and link this issue and the separate proposed fix #3824.
The existing #3824 explanation matches the code inspected here:
similar::planusesmedia.source_ref, which can return an already-loaded source, while this fixture counts only file-loader calls on search threads. This report adds the observed failure; it does not claim a new independent local run on bare main.gmrmad1 commentedon Nov 15, 2026
Taking this — PR to follow shortly.
AlexChambers commentedon Nov 15, 2026
@gmrmad1, #3824 (Bruno-Alumn) already fixes this. lostwald re-checked it on current main today: it merges cleanly and the 11
find_similartests pass. So a second PR may not be needed. A review on #3824 would help most.ChokunPlayZ commentedon Nov 15, 2026
Hit this again while checking #4279 (macOS arm64, Rust 1.95.0, release-profile quick gate, 3 test threads):
The Find Similar files are unchanged from main. Keeping the existing fix in #3824 separate; I have not rerun this test to get a pass.
Find Similar test: a photo read from memory isn't a missing read (#3823)
scottmcqueen commentedon Nov 16, 2026
Another occurrence: macOS 27.0.1 aarch64, rustc 1.99.0,
cargo xtask ci --quickon #4349's branch (mainat 2dcb258 plus Lens Blur changes; nothing in Find Similar), while anothercargo testrun was loading the machine.find_similar.rs:170: left 11, right 12. Run alone it passed three times out of three. Seems to support getting #3824 reviewed.ugubser commentedon Nov 16, 2026
Observed the same failure on Linux x86_64 during local integration of #3268 and #3964 on main a349817 (Find Similar implementation and test unchanged):
The earlier full gate on the ComfyUI-only integration passed this test. Code inspection confirms that media.source_ref can return cached pixels populated by Detail/filmstrip rendering, so a completed search need not perform 12 file-loader calls. I am checking the existing test-only correction from #3824 locally rather than changing production search behavior or disabling the test.
Find Similar test: a photo read from memory isn't a missing read (#3823)
Merge pull request #3824 from Bruno-Alumn/fix/flaky-find-similar-3823
Decode AVIF through shared image codecs (#4312)