Skip to content

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

Closed

Description

@AlexChambers

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:

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:164:5:
assertion `left == right` failed
  left: 10
 right: 12

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.

Activity

  1. added
    bug
    on Nov 5, 2026
  2. ticket-craft commented on Nov 5, 2026

    @ticket-craft

    Possibly related: #3799.

  3. AlexChambers commented on Nov 5, 2026

    @AlexChambers
    ContributorAuthor

    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.

  4. jllubia commented on Nov 7, 2026

    @jllubia

    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.

  5. lostwald commented on Nov 10, 2026

    @lostwald
    Contributor

    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.

    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:

    ---- tests::find_similar::stopping_leaves_the_view_alone_and_the_next_search_reads_only_the_rest stdout ----
    assertion failed at crates/ui-egui/src/tests/find_similar.rs:170:5
      left: 10
     right: 12
    
    test result: FAILED. 1930 passed; 1 failed; 4 ignored
    

    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.

  6. gmrmad1 commented on Nov 15, 2026

    @gmrmad1
    Contributor

    Taking this — PR to follow shortly.

  7. AlexChambers commented on Nov 15, 2026

    @AlexChambers
    ContributorAuthor

    @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.

  8. ChokunPlayZ commented on Nov 15, 2026

    @ChokunPlayZ

    Hit this again while checking #4279 (macOS arm64, Rust 1.95.0, release-profile quick gate, 3 test threads):

    crates/ui-egui/src/tests/find_similar.rs:170:5
    left: 10
    right: 12
    1942 passed; 1 failed; 4 ignored
    

    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.

  9. scottmcqueen commented on Nov 16, 2026

    @scottmcqueen

    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.

  10. ugubser commented on Nov 16, 2026

    @ugubser

    Observed the same failure on Linux x86_64 during local integration of #3268 and #3964 on main a349817 (Find Similar implementation and test unchanged):

    crates/ui-egui/src/tests/find_similar.rs:170:5
    assertion `left == right` failed
      left: 10
     right: 12
    1941 passed; 1 failed; 4 ignored
    

    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.

  11. added 2 commits that reference this issue on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions