Skip to content

test(coop): wait for the Ufopaedia section button in the craft deployment test - #236

Merged
NonPolynomialTim merged 1 commit into
mainfrom
test/craft-deployment-click-settle
Nov 6, 2026
Merged

NonPolynomialTim merged 1 commit into
mainfrom
test/craft-deployment-click-settle

Conversation

@NonPolynomialTim

Copy link
Copy Markdown
Collaborator

Problem

tools/coop_test/test_shared_craft_deployment.py sometimes fails a row with preview drive craft_section ... ['X-COM CRAFT & ARMAMENT', []]. It failed craft_deploy_separate in one of three local runs on main (8ccc045).

Cause

The preview drive opens the Ufopaedia and clicks "X-COM CRAFT" after a fixed 0.3 s settle. UfopaediaStartState opens as a popup window (POPUP_BOTH), which hides every button while it opens. That takes about 20 frames, or about 0.3 s at the 15.6 ms Windows tick. A hidden button drops the click, and click_widget still answers ok. In the failing run, the client's log shows UfopaediaStartState pushed and no UfopaediaSelectState after the click.

Evidence: with the start screen held at 50 ms frames (slow_top {type: UfopaediaStartState, ms: 50}), list_widgets read right before each click shows the button as {"visible": true, "hidden": true}. Every click returns ok: true, the select screen never opens, and five rows fail: craft_deploy_1 to craft_deploy_4 and craft_deploy_separate. That happened in 3 of 3 runs.

Fix

Test-only. The drive now calls session.wait_widget_ready(gc, "X-COM CRAFT") before the click, the same wait test_preview_restream.py and test_client_research.py use. If the button never shows, the craft_section miss now records the wait result. The other screens the drive clicks (the select list, the craft article, INFO, the abort box) are not popup windows, and the drive already waits for each one to be on top.

Test

  • Under the 50 ms start-screen frames: 8 of 8 on harness slots 6 and 7. The button reads hidden: false at every click.
  • Plain runs: 20 of 20 (10 per slot, two slots at once), each run 31-68 s.
  • No other test imports this file.

…eview drive clicks it

The craft deployment test opens the Ufopaedia and clicks "X-COM CRAFT" after a fixed 0.3 s settle.
UfopaediaStartState opens as a popup window, which hides every button for about 20 frames (about 0.3 s
at the 15.6 ms Windows tick). A hidden button drops the click, click_widget still answers ok, and the
row fails with an empty craft list. It failed one of three local runs on main.

With the start screen held at 50 ms frames (slow_top), the button reads hidden at every click and five
rows fail, 3 of 3 runs. The drive now waits with session.wait_widget_ready, as test_preview_restream
already does, and passes 8 of 8 under the same slow frames on both harness slots and 20 of 20 plain runs.
@NonPolynomialTim
NonPolynomialTim enabled auto-merge (squash) November 6, 2026 02:21
@NonPolynomialTim
NonPolynomialTim merged commit 6a6567d into main Nov 6, 2026
11 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.

1 participant