Skip to content

test(ui): isolate compact plugin ribbon smoke test - #3037

Merged
Mavrick-F merged 1 commit into
opengeos:mainfrom
ninhhaidang:fix/2899-plugin-smoke-isolation
Nov 26, 2026
Merged

Mavrick-F merged 1 commit into
opengeos:mainfrom
ninhhaidang:fix/2899-plugin-smoke-isolation

Conversation

@ninhhaidang

@ninhhaidang ninhhaidang commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Summary

Run the compact plugin ribbon smoke test in its own process, using the existing helper so concurrent storage-account tests cannot change its account state. Use the existing Unload guard to clean up the fixture on panic.

Scope is the desktop UI smoke test.

Testing

  • macOS arm64: all 151 smoke tests passed. The nine affected and neighboring tests passed 20 consecutive runs with isolation. With isolation bypassed, the compact ribbon test failed at its nested-command assertion on run 19.
  • cargo xtask ci: test hygiene, formatting, and workspace Clippy passed. The workspace test run stopped at tests::layout_title::a_wrapped_map_title_is_sized_for_its_drawn_lines in rustgis-engine. That test also failed in isolation on this Mac.

UI evidence

No visible UI change.

Related issue

Closes #2899

Summary by CodeRabbit

  • Tests
    • Updated automated checks for ribbon columns and nested menus to run in an isolated process and ensure plugin cleanup after each test.
    • These changes affect test execution only; no user-facing behavior has changed.

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The plugin smoke test now runs its existing body in an isolated process. It uses an Unload guard to unload ui-small when the test scope ends.

Changes: Plugin smoke test isolation

Layer / File(s) Summary
Isolate test and unload plugin
crates/ui-egui/tests/smoke.rs
The test returns in the parent process after starting its isolated run. An Unload guard replaces the explicit unload at the end of the test.

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

Change: Other · Severity of issue fixed: Low

Possibly related PRs

  • opengeos/RustGIS#1115: This PR introduced the smoke test that this change isolates and updates for plugin cleanup.

Suggested reviewers: deniial00

Merge Risk: Minimal · up to 97b43

This test-only change makes a flaky smoke test run in isolation and cleans up its plugin fixture. It does not alter product behavior, and no merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title is specific and matches the changeset. The PR changes only the smoke test in crates/ui-egui/tests/smoke.rs. It runs the compact plugin ribbon test in an isolated process and switches its cle…
Description check Passed The description follows the repository template. It includes Summary, Testing, UI evidence, and Related issue sections. The Summary explains what changed and why. Testing lists the macOS smoke test ru…
Linked Issues check Passed Issue #2899 asks for a test-only fix in plugin_small_ribbon_columns_and_nested_menus_preserve_actions (crates/ui-egui/tests/smoke.rs). Its requirements are: (1) run the test in its own process before …
Out of Scope Changes check Passed The reported change set is confined to crates/ui-egui/tests/smoke.rs, with +4/-1 lines. It consists of the isolation guard for the targeted test and the Unload guard that replaces its explicit unload.…
Full details: Title check

Explanation

The title is specific and matches the changeset. The PR changes only the smoke test in crates/ui-egui/tests/smoke.rs. It runs the compact plugin ribbon test in an isolated process and switches its cleanup to the Unload guard. The title says test(ui) and names the compact plugin ribbon smoke test, which is the main change. It does not mention the Unload guard, but that detail is secondary.

Full details: Description check

Explanation

The description follows the repository template. It includes Summary, Testing, UI evidence, and Related issue sections. The Summary explains what changed and why. Testing lists the macOS smoke test runs and the cargo xtask ci results, including a failing test that the author reports also fails in isolation. UI evidence correctly states 'No visible UI change.' as the template allows. Related issue links #2899. The Testing section does not say whether the failing rustgis-engine test is related to this change, but the description reports it accurately.

Full details: Linked Issues check

Explanation

Issue #2899 asks for a test-only fix in plugin_small_ribbon_columns_and_nested_menus_preserve_actions (crates/ui-egui/tests/smoke.rs). Its requirements are: (1) run the test in its own process before it takes the PLUGINS lock, using in_own_process; (2) unload ui-small through the Unload guard so a panic does not leave the plugin loaded. The PR summary and the reviewed change summary both report that the test now returns early in the parent process after rerunning itself in an isolated process, and that its plugin unload uses an Unload guard in place of the former explicit unload at the end of the test. This matches both requirements. The issue also states that the app's storage-account check must stay unchanged; the PR touches only test code, so this holds. The PR description reports 20 isolated runs passing and one failure with isolation bypassed. Limitation: the text diff could not be read (changed blobs unavailable in the checkout), and the file read was truncated before the test body. The exact placement of the in_own_process guard relative to the PLUGINS lock is therefore taken from the summary, not from source.

Full details: Out of Scope Changes check

Explanation

The reported change set is confined to crates/ui-egui/tests/smoke.rs, with +4/-1 lines. It consists of the isolation guard for the targeted test and the Unload guard that replaces its explicit unload. Both changes implement #2899 directly. No production code, no other tests, and no UI behavior change are reported. The PR description's note that the failing test in rustgis-engine (tests::layout_title::a_wrapped_map_title_is_sized_for_its_drawn_lines) also fails on the author's machine in isolation is a pre-existing condition, not a change introduced here. Limitation: the diff text could not be read, so this verdict relies on the summary's description of the change.

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 watched the test take flight,
To run alone and clear the night.
The plugin guard stays on its trail,
And unloads it without fail.
Then hops away, with carrots bright.

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: d6c8760f-5852-4867-9755-2f652f737017
Commits

Reviewing files that changed from the base of the PR and between e185e02 and 97b4306.

Files selected for processing: 1

  • crates/ui-egui/tests/smoke.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.

Comment thread crates/ui-egui/tests/smoke.rs Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Code review

I found no bugs, security issues or AGENTS.md violations in this 4-line test change. One test-isolation question is posted inline. Prior reviews: none on this PR, so no concerns were left alone.

Bugs: None found. Checked:

  • in_own_process runs before the PLUGINS lock, so the parent returns early without taking it, and the child (env RUSTGIS_SMOKE_ALONE set) runs the body. Nesting is safe.
  • let _unload = Unload("ui-small") is placed after rp::load, so a failed load has nothing to unload. It is declared before h, so the harness drops first and the unload runs on panic too. The old trailing rp::unload is removed, so there is no double unload. Confidence: high.

Security: None. The child is started with current_exe() and fixed arguments.

Performance: None. The test now runs in a child process, which costs one extra test-binary start. That is acceptable for a smoke test.

Quality:

  • Posted inline (smoke.rs:1802): plugins_can_have_a_tab_of_their_own (smoke.rs ~1743, unchanged) has the same kind of plugin setup, with login: "earthdata" on its commands, and it is not isolated. Confidence: medium-low that it flakes. I did not confirm that its login-gated buttons check account state.
  • Not raised: a_second_click_on_a_plugin_command_about_to_start_runs_it_once (~1925) loads ui-again without an Unload guard. This predates the PR and does not use logins, so I left it alone.

Twins checked: The other in_own_process user (plugin_picks_take_a_place_on_the_map) already follows the same pattern. The service_logins module shares the binary but I did not find a static lock or account-state reset in it, so I could not confirm which test it interacts with. Plugin tests that use login keys: only smoke.rs:1754, 1809 and 1810.

Not verified: Linux CI behaviour for this test. The PR reports 20 isolated runs on macOS only. The layout_title failure in the PR body is unrelated to this diff.

Change size

Compared: the whole PR against main (merge base e185e02 to PR head 97b4306).

Measure Value
Files changed 1 (added 0, modified 1, removed 0, renamed 0)
Size before 271.2 KB
Size after 271.3 KB
Total size change +121 B
Path Before After Change
crates/ui-egui/tests/smoke.rs 271.2 KB 271.3 KB +121 B

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Commit 97b4306 from a fork built, but isn't published until a maintainer adds the preview label (once per commit).

@ninhhaidang
ninhhaidang marked this pull request as ready for review November 26, 2026 18:08
Copilot AI balanced review requested due to automatic review settings November 26, 2026 18:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

Scope: one test-only change in crates/ui-egui/tests/smoke.rs. It moves plugin_small_ribbon_columns_and_nested_menus_preserve_actions into a child process via the existing in_own_process helper and swaps the trailing rp::unload for the existing Unload drop guard.

No inline comments were posted. The only findings are minor, and I did not find anything that needs a line-level comment.

Bugs: None found (high confidence). I checked the drop order. _turn (the PLUGINS lock) is declared first, _unload second, and the harness h last. So the plugin is unloaded while the lock is still held, and the unload runs on panic as well. The guard is placed after rp::load(...).unwrap(), so a failed load leaves nothing to unload. The early return sits before PLUGINS.lock(), so the parent process doesn't hold the lock while the child runs.

Security: None. The child is spawned with current_exe() and fixed arguments, and the test name is a literal.

Performance: None of note (high confidence). The test binary runs one extra time, in a child that runs only this test.

Quality:

  • Low confidence, not verified: in_own_process isolates process-wide state. If the storage-account state is also persisted on disk, a parent-process test could still race with the child. The helper's doc comment describes the state as process-wide, which suggests it is in memory. I did not confirm this. Worth a look if the flake recurs.
  • Nit, left for the release quality pass: the same Unload guard would help the other manual unloads in this file at lines 1797 (ui-tab), 1948 (ui-again) and 4754 (ui-panel). A panic there leaves the plugin loaded for later tests. These lines are unchanged by this PR, so they are out of scope here.

AGENTS.md: No breaks found (high confidence). The change is test-only. It adds no timer waits, so no test-wait marker is needed. It has no assert_eq! with identical sides. The expect in in_own_process is in test code, so it is allowed. No command is added, removed or renamed, so command-surface.txt is unaffected. The "Reach every surface" checklist does not apply to a test-only change.

Prior reviews: I left 1 earlier concern alone. It was the github-actions quality thread on plugins_can_have_a_tab_of_their_own, a possible sibling flake. The PR author answered it with 30 runs of evidence and deferred the stronger coverage to the release quality pass. Nothing in the diff changes that test, so I did not raise it again.

Change size

Compared with main (merge base e185e02 to PR head 97b4306). This covers the whole PR, not only the latest push.

Measure Value
Files changed 1 (0 added, 1 modified, 0 removed, 0 renamed)
Size before 271.2 KB
Size after 271.3 KB
Total size change +121 B
Path Before After Change
crates/ui-egui/tests/smoke.rs 271.2 KB 271.3 KB +121 B

@Mavrick-F
Mavrick-F added this pull request to the merge queue Nov 26, 2026
Merged via the queue into opengeos:main with commit 9b822cb Nov 26, 2026
29 checks passed
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: plugin_small_ribbon_columns_and_nested_menus_preserve_actions races the storage account tests

3 participants