[PR #1124] [MERGED] Tests: the menu style is per test thread (fixes the classic_graphics_presets flake) #3070

Closed
opened 2026-11-02 16:01:15 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1124
Author: @ludovic111
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @ludovic111

Base: main ← Head: fix/menu-style-test-race


📝 Commits (1)

  • aaf6384 Tests: the menu style is per test thread, so parallel tests can't flip it

📊 Changes

1 file changed (+30 additions, -10 deletions)

View changed files

📝 crates/horizon-client/src/ui_theme.rs (+30 -10)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

What

Under cfg(test) the menu style (ui_theme::style / set_style) is a thread local, Classic first. The game keeps its process-wide atomic.

Why (#802)

Options tests switch the style to lay out a page in Horizon's or Classic's style and restore it afterwards. Cargo runs tests in parallel threads, so one test's switch moved another test's widgets: options_ui::tests::classic_graphics_presets_set_the_distances failed in CI's verify (#721, #789). LookImEcho-Rick offered on 2026-10-18 to take it; the agent asked on the issue first (no branch or PR existed) and had no reply after three hours. If Rick has his own fix, prefer his.

How tested

  • New test a_test_switching_the_style_leaves_other_tests_classic.
  • The options and ui_theme tests 200 times in a row (horizon_client-* options_ ui_theme): origin/main failed 4 of 200 runs, this branch 0 of 200.

Fixes #802

Self-check (Mac mini, one integration commit of the five Q1 PRs on origin/main 2d586fac)

  • cargo fmt --all --check: clean
  • set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings: clean (no warnings, no errors)
  • cargo test -p horizon-client: lib 962 passed (14 ignored), main 84 passed, horizon-ctl 15 passed, integration tests 7 passed
  • tools/parity.py --changed origin/main: all 101 affected harnesses pass (secure_chat failed once in the batch run, which reused cached oracle results, then passed when rerun alone)

Needs Ludovic

Nothing.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1124 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/menu-style-test-race` --- ### 📝 Commits (1) - [`aaf6384`](https://github.com/horizon-rust/horizon/commit/aaf638475141454351005b3cc0ceb788d36fc28d) Tests: the menu style is per test thread, so parallel tests can't flip it ### 📊 Changes **1 file changed** (+30 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/ui_theme.rs` (+30 -10) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What Under `cfg(test)` the menu style (`ui_theme::style` / `set_style`) is a thread local, Classic first. The game keeps its process-wide atomic. ## Why (#802) Options tests switch the style to lay out a page in Horizon's or Classic's style and restore it afterwards. Cargo runs tests in parallel threads, so one test's switch moved another test's widgets: `options_ui::tests::classic_graphics_presets_set_the_distances` failed in CI's verify (#721, #789). LookImEcho-Rick offered on 2026-10-18 to take it; the agent asked on the issue first (no branch or PR existed) and had no reply after three hours. If Rick has his own fix, prefer his. ## How tested - New test `a_test_switching_the_style_leaves_other_tests_classic`. - The options and ui_theme tests 200 times in a row (`horizon_client-* options_ ui_theme`): origin/main failed 4 of 200 runs, this branch 0 of 200. Fixes #802 ## Self-check (Mac mini, one integration commit of the five Q1 PRs on origin/main 2d586fac) - `cargo fmt --all --check`: clean - `set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings`: clean (no warnings, no errors) - `cargo test -p horizon-client`: lib 962 passed (14 ignored), main 84 passed, horizon-ctl 15 passed, integration tests 7 passed - `tools/parity.py --changed origin/main`: all 101 affected harnesses pass (secure_chat failed once in the batch run, which reused cached oracle results, then passed when rerun alone) ## Needs Ludovic Nothing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 16:01:15 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3070
No description provided.