Skip to content

test(ui): stabilize Select By Attributes dialog interactions - #3366

Merged
Mavrick-F merged 1 commit into
opengeos:mainfrom
Mavrick-F:test/select-by-attributes-values-flake
Nov 29, 2026
Merged

Mavrick-F merged 1 commit into
opengeos:mainfrom
Mavrick-F:test/select-by-attributes-values-flake

Conversation

@Mavrick-F

@Mavrick-F Mavrick-F commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Summary

The background count can request a repaint while the dialog tests are waiting for the UI to go idle. On Ubuntu, the test in #3340 hit the harness's four-frame limit while opening the Values menu. It settled after six frames.

Process input directly and give the menu a layout frame before inspecting or clicking it. The values-list, completion and keyboard tests can now check their own behavior while the match count runs.

Testing

Ran the seven values-list tests 100 times before and after with the test process and a competing process pinned to the same CPU. Failures fell from 9/700 to 0/700.

Values-list test Before After
does_not_change_while_open 1/100 0/100
fills_the_gap_at_the_cursor 0/100 0/100
follows_the_field_typed 0/100 0/100
lists_nothing_beside_a_computed_left_side 0/100 0/100
quotes_values_and_says_where_they_come_from 2/100 0/100
says_why_a_wildcard_value_is_not_added_after_like 0/100 0/100
writes_what_it_lists 6/100 0/100

Related dialog tests passed. Each values-list test and each changed keyboard, completion and cancellation test failed when the behavior it checks was deliberately broken. Formatting and cargo xtask test-hygiene passed.

The fork CI gate passed, and all seven values-list tests passed on their first attempt on Ubuntu.

UI evidence

No visible UI change.

Related issue

Closes #3340

Summary by CodeRabbit

  • Tests
    • Updated dialog UI tests to advance frames in explicit, bounded steps while checking Enter-key handling, expression suggestions, and the Select By Attributes values list.

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Dialog UI tests now use step() and bounded run_steps() calls around keyboard input, expression suggestions, and the Select By Attributes Values list. The test assertions and application code remain unchanged.

Changes: Dialog test frame advancement

Layer / File(s) Summary
Keyboard and suggestion test frame advances
crates/ui-egui/src/dialogs.rs
Keyboard and expression-suggestion tests use explicit frame advances instead of run() calls. Their assertions remain unchanged.
Values-list test frame advances
crates/ui-egui/src/dialogs.rs
Values-list tests use step() and run_steps() around menu opening and other interactions. Their assertions remain unchanged.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other · Severity of issue fixed: Low

Possibly related issues

  • Issue 3204 reports flakiness in a Values-list test. This change updates frame advancement in that test family.
  • Issue 3193 reports a retry-only failure in a Values-list test. The changed tests use explicit frame advances around field selection and menu interactions.
  • Issue 3170 reports a retry-only failure in a Values-list test involving quoted values. The changed test uses explicit frame advances around field and value clicks.
  • Issue 3207 reports a retry-only failure in a Values-list test involving wildcard values. This change updates frame advancement in Values-list tests.

Possibly related PRs

  • opengeos/RustGIS#2971: This PR adds the Values menu whose interactions are covered by the updated tests.

Suggested reviewers: jgregoriorincon, giswqs

Merge Risk: Minimal · up to 767e9

This change makes dialog UI tests deterministic by advancing frames explicitly instead of running until idle, which fixes the flaky Values-list test in issue #3340. It does not affect shipped behavior and is low risk to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the test area and the main purpose of the change, stabilizing Select By Attributes dialog interactions. The raw summary says the dialog tests replace Harness::run() calls with step() o…
Description check Passed The description follows the template. It has a Summary that explains the cause (background count requests repaints, causing the four-frame limit to be hit) and the fix. It has a Testing section with b…
Linked Issues check Passed [#3340] The linked issue asks for a fix to the flaky test dialogs::tests::select_by_attributes_values_list_does_not_change_while_open. It asks that timer-based waits wait for completion instead. The…
Out of Scope Changes check Passed [#3340] The changes are limited to test code in crates/ui-egui/src/dialogs.rs, per the summary. Application code is unchanged; the summary lists no changed declarations. The PR description says the …
Full details: Title check

Explanation

The title names the test area and the main purpose of the change, stabilizing Select By Attributes dialog interactions. The raw summary says the dialog tests replace Harness::run() calls with step() or bounded run_steps() calls, and the objectives say input is processed directly and a layout frame is given before the menu is inspected. The title uses the conventional test(ui) prefix and is specific enough for a teammate scanning history.

Full details: Description check

Explanation

The description follows the template. It has a Summary that explains the cause (background count requests repaints, causing the four-frame limit to be hit) and the fix. It has a Testing section with before/after flakiness numbers, the tests run, and CI results. The UI evidence section states 'No visible UI change.', which matches the template's allowance for changes with no visible UI effect. The Related issue section cites Closes #3340. The template's HTML comments are removed, as expected.

Full details: Linked Issues check

Explanation

[#3340] The linked issue asks for a fix to the flaky test dialogs::tests::select_by_attributes_values_list_does_not_change_while_open. It asks that timer-based waits wait for completion instead. The PR changes the dialog tests in crates/ui-egui/src/dialogs.rs so they advance frames with step() or bounded run_steps() instead of Harness::run(), which waited for the UI to go idle. The PR description states that the background match count requests repaints, which kept the idle wait from settling within the four-frame limit. The PR gives the Values menu a layout frame before it is inspected or clicked, and processes input directly. The author reports 9/700 failures before and 0/700 after under CPU contention, and first-attempt passes on Ubuntu. Limits: the text diff could not be read (changed blobs missing from the checkout). This verdict rests on the AI-generated summary and the PR description, not on a direct read of the test hunk. The fix uses fixed frame stepping rather than an explicit wait for a completion signal. That is a reasonable reading of the issue, but it is not a literal wait for completion.

Full details: Out of Scope Changes check

Explanation

[#3340] The changes are limited to test code in crates/ui-egui/src/dialogs.rs, per the summary. Application code is unchanged; the summary lists no changed declarations. The PR description says the changed tests are the values-list, keyboard, completion and cancellation tests in the Select By Attributes dialog. These tests use the same idle-wait pattern that causes the flakiness, so their stepping changes are connected to the stated fix. No change was shown to be unrelated to the linked issue. The diff could not be read, so line-level scope is not confirmed.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit taps one frame at a time,
Then checks the menu in a steady line.
The keys still press, the values appear,
The tests step onward, clear and sure.
I nibble greens and hop away!

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 5c997669-a145-4b49-8f5b-ccccf26af051
Commits

Reviewing files that changed from the base of the PR and between 71ded77 and 767e9b0.

Files selected for processing: 1

  • crates/ui-egui/src/dialogs.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

I reviewed the whole diff: one file, crates/ui-egui/src/dialogs.rs, test code only (+46/−43 lines). I did not run the tests or cargo xtask, since I have no shell here. The PR's flake numbers (9/700 down to 0/700) are therefore unverified by me.

Bugs: none found. The changed assertions still check the same behaviour. The cancel test's stop flag is set when the Count is dropped (matchcount.rs:95), so one step() after Cancel is enough. step and run_steps are already used across the crate. Confidence: high.

Security: none.

Performance: none.

Quality (nits, no inline comments posted):

  • Several Select By Attributes tests still call h.run(). enter_on_a_clause_menu_does_not_run_the_dialog (dialogs.rs:3927-3929) is the closest twin. It opens the Functions list the same way as the converted drop-down test. I left it alone: its clause (pop_est >) is invalid, so no match count runs, and the flake mechanism in the PR does not apply. Confidence: medium.
  • The Rename layer and Calculate Field tests (dialogs.rs:4168-4220, 4614-4691) still use h.run(). They are outside this PR's scope, and I did not find evidence that they flake.
  • The fixed run_steps(2) waits are a frame-count guess rather than a completion signal. The PR's reason (a popup needs one layout frame after a click) makes that reasonable here, so I am not raising it.

AGENTS.md: no breaks found. No timer waits were added, no assert_eq! compares identical tokens, and no command, layer or file behaviour changed.

Earlier concerns: none. prior-reviews.json has no threads.

Change size

Compared with the base branch: the whole PR against main (merge base f943424 to PR head 767e9b0).

Measure Value
Files changed 1 (added 0, modified 1, removed 0, renamed 0)
Size before 297.0 KB (304,122 B)
Size after 297.3 KB (304,483 B)
Total size change +361 B
Path Before After Change
crates/ui-egui/src/dialogs.rs 297.0 KB 297.3 KB +361 B

@Mavrick-F
Mavrick-F added this pull request to the merge queue Nov 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-3366/
Web app https://preview.rustgis.app/pr-3366/app/
Commit 767e9b0

GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the preview label (once per commit).

Merged via the queue into opengeos:main with commit adc0aec Nov 29, 2026
28 checks passed
@Mavrick-F
Mavrick-F deleted the test/select-by-attributes-values-flake branch November 29, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky test: rustgis-ui-egui dialogs::tests::select_by_attributes_values_list_does_not_change_while_open

1 participant