Skip to content

[rust] fix flaky tests - #18073

Merged
titusfortner merged 1 commit into
SeleniumHQ:trunkfrom
titusfortner:rust-flaky-browser-tests
Sep 24, 2026
Merged

titusfortner merged 1 commit into
SeleniumHQ:trunkfrom
titusfortner:rust-flaky-browser-tests

Conversation

@titusfortner

Copy link
Copy Markdown
Member

💥 What does this PR do?

  • Fixes two unrelated sources of flakiness in the Selenium Manager browser tests

🔧 Implementation Notes

  • browser_path_version_mismatch_test and browser_path_major_version_mismatch_test both wrote /tmp/fake-chrome-131-0-6778-264, so in parallel each could overwrite the other's fake browser mid-run; each now gets its own tempfile::tempdir(). Passes 3/3 with --runs_per_test=3.
  • geckodriver has no linux-aarch64 build before 0.32.0 and every Firefox case here asks for 0.31.0 or older, so those downloads 404. They are now skipped on arm64 the same way the Chrome and Edge cases already are.

🤖 AI assistance

  • No substantial AI assistance used
  • AI assisted (complete below)
    • Tool(s): Claude Code (Opus 5)
    • What was generated: diagnosis, fix, and this description
    • I reviewed all AI output and can explain the change

💡 Additional Considerations

  • The Edge cases in the same target still fail intermittently on error decoding response body from msedgedriver.microsoft.com, which is a download-side failure and not addressed here.

🔄 Types of changes

  • Bug fix (backwards compatible)

…ipping geckodriver versions with no linux arm64 build
@selenium-ci selenium-ci added C-rust Rust code is mostly Selenium Manager B-manager Selenium Manager labels Sep 23, 2026
@qodo-code-review

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Stabilize Rust browser tests on parallel runs and ARM64

🐞 Bug fix 🧪 Tests 🕐 Less than 10 minutes

Grey Divider

AI Description

• Isolates fake Chrome executables per mismatch test to prevent parallel file overwrites.
• Skips unavailable legacy geckodriver cases on Linux ARM64 to avoid download failures.
Diagram

graph TD
  A["Version cases"] --> B{"Linux arm64?"} -- "Yes" --> C{"Artifact exists?"} -- "No" --> D["Skip case"]
  B -- "No" --> E["Run manager"]
  C -- "Yes" --> E
  F["Mismatch cases"] --> G["Private tempdir"] --> E
Loading
High-Level Assessment

The PR uses the appropriate minimal fixes for both failure modes. Per-test temporary directories provide lifecycle-managed isolation without serializing the suite, while the ARM64 guard accurately avoids release artifacts that do not exist. Global unique filenames and forced test serialization were considered but provide weaker cleanup or reduce parallelism.

Files changed (1) +8 / -5

Bug fix (1) +8 / -5
browser_tests.rsIsolate fake browsers and skip unavailable ARM64 geckodrivers +8/-5

Isolate fake browsers and skip unavailable ARM64 geckodrivers

• Adds Firefox to the Linux ARM64 exclusion because the tested geckodriver versions predate ARM64 builds. Refactors fake-browser creation to use a caller-provided temporary directory, preventing parallel mismatch tests from overwriting a shared executable.

rust/tests/browser_tests.rs

@titusfortner titusfortner changed the title [rust] fix flaky browser tests by isolating fake browser files and skipping geckodriver versions with no linux arm64 build [rust] fix flaky tests Sep 24, 2026
@titusfortner
titusfortner merged commit 587731e into SeleniumHQ:trunk Sep 24, 2026
28 checks passed
This was referenced Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-manager Selenium Manager C-rust Rust code is mostly Selenium Manager

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants