Skip to content

test(ui): the Summarize Within test waits for its background run - #1343

Merged
giswqs merged 1 commit into
mainfrom
fix/summarize-within-test-waits-for-run
Nov 2, 2026
Merged

giswqs merged 1 commit into
mainfrom
fix/summarize-within-test-waits-for-run

Conversation

@giswqs

@giswqs giswqs commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Main's test / Test (ubuntu-latest) failed on e0e1c77 at crates/ui-egui/tests/tool_field_lists.rs:497: gp.last was None after Run.

Cause: merge skew. #1317 moved Tools-pane runs to a background thread and added click_run, which waits for the run to land. #1253 added summarize_within_statistics_offer_the_point_layers_fields with the old click-and-three-frames pattern. Its PR checks passed because they predate that interaction, and on main the result depends on whether the thread finishes within three frames.

Fix: the test uses click_run, like every other test in the file. Only the test changes; its assertions stay.

Evidence: on an unloaded machine the old test passes. Pinned to one core with the machine under load, it failed 2 of 40 runs at the same line. With the fix, 0 of 40 under similar load, and all 16 tests in the file pass.

Summary by CodeRabbit

  • Tests
    • Updated a test to wait for the tool run to finish before proceeding.

Tools-pane runs moved to a thread of their own in #1317, which added
click_run for the tests. #1253 branched before that, so its new test
clicked Run and stepped three frames, and failed whenever the thread
hadn't landed by then.
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

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: fc1be17d-628b-4187-85b1-58edb222a88c
Commits

Reviewing files that changed from the base of the PR and between e0e1c77 and 9b5b628.

Files selected for processing: 1
  • crates/ui-egui/tests/tool_field_lists.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.

Walkthrough

The test now uses click_run to wait for the tool run to finish instead of clicking Run and advancing three steps.

Changes: Tool run test

Layer / File(s) Summary
Wait for tool run completion
crates/ui-egui/tests/tool_field_lists.rs
The test uses click_run instead of a direct Run-button click and a fixed three-step wait.

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

Change: Bug fix

Possibly related PRs

Suggested reviewers: pawelkra

Merge Risk: Minimal · up to 9b5b6

The test now waits for the background run to complete rather than relying on frame timing. No actionable merge-blocking risk is identified; mergeable subject to normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly identifies the test change and the background-run waiting behavior. It is concise and accurately reflects the main change.
Description check Passed The description explains the failure, cause, fix, test evidence, and affected test. It is mostly complete, although it does not use the template headings explicitly or state the UI evidence section ve…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the failure, cause, fix, test evidence, and affected test. It is mostly complete, although it does not use the template headings explicitly or state the UI evidence section verbatim.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • 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 Run with care,
Then waits for the tool to be there.
No fixed steps to count,
Just completion to announce.
The test hops on, prepared.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Code review

I found nothing worth raising in this PR. It is a two-line test change, and I checked the fix against the code it depends on.

Bugs: none found. Confidence: high.

  • The edited test (crates/ui-egui/tests/tool_field_lists.rs:495) now calls click_run, the helper already used by the other tests in the file. Its wait loop is sound. start_tool_run sets gp.tool_run during the click frame (crates/ui-egui/src/panes.rs:2716). poll_tool_run clears tool_run in the same call that writes the result to gp.last (panes.rs:2746–2748). So the loop exits only after the result has landed, and the gp.last.unwrap() assertion that follows is safe.
  • The test's assertions are unchanged, as the PR description says.
  • The other Run-click tests are not affected. crates/ui-egui/src/cubesui.rs:302 clicks Run on a workflow validation path, not a background tool run. crates/ui-egui/src/panes.rs:6493 has its own wait loop.

Security: none. Confidence: high. The change is test-only.

Performance: none. Confidence: high. The wait polls every 5 ms with a 60-second cap, which is fine for a test.

Quality: none worth raising now. Confidence: high. One optional note: if poll_tool_run takes its "project closed" branch, gp.last stays None and the test fails at unwrap() with no clear message. That is a pre-existing gap in the test, not something this PR introduces, so I did not raise it.

AGENTS.md: compliant. Confidence: high. Test code may use unwrap(), no new user-visible strings were added, and no dependencies changed.

Prior review threads: none on this PR, so none were left alone.

Change size

Compared: the whole PR against main (merge base e0e1c77 to PR head 9b5b628).

Measure Value
Files changed 1 (added 0, modified 1, removed 0, renamed 0)
Size before 25.3 KB
Size after 25.2 KB
Total size change -72 B
Path Before After Change
crates/ui-egui/tests/tool_field_lists.rs 25.3 KB 25.2 KB -72 B

@giswqs
giswqs merged commit 275deb6 into main Nov 2, 2026
18 checks passed
@giswqs
giswqs deleted the fix/summarize-within-test-waits-for-run branch November 2, 2026 21:05
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-1343/
Web app https://preview.rustgis.app/pr-1343/app/
Commit 9b5b628

GitHub Pages takes a minute or two to publish a new commit.

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.

1 participant