Skip to content

Stabilize permissions popup selection tests#14966

Merged
aibrahim-oai merged 3 commits intomainfrom
codex/permissions-popup-selection-stability
Mar 17, 2026
Merged

Stabilize permissions popup selection tests#14966
aibrahim-oai merged 3 commits intomainfrom
codex/permissions-popup-selection-stability

Conversation

@aibrahim-oai
Copy link
Copy Markdown
Collaborator

What is flaky

The permissions popup tests in the TUI are flaky, especially on Windows. They assume the popup opens on a specific row and that a fixed number of Up or Down keypresses will land on a specific preset. They also match popup text too loosely, so a non-selected row can satisfy the assertion.

Why it was flaky

These tests were asserting incidental rendering details rather than the actual selected permission preset. On Windows, the initial selection can differ from non-Windows runs. Some tests also searched the entire popup for text like Guardian Approvals or (current), which can match a row that is visible but not selected. Once the popup order or current preset shifted slightly, a test could fail even though the UI behavior was still correct.

How this PR fixes it

This PR adds helpers that identify the selected popup row and selected preset name directly. The tests now assert the current selection by name, navigate to concrete target presets instead of assuming a fixed number of keypresses, and explicitly set the reviewer state in the cases that require Guardian Approvals to be current.

Why this fix fixes the flakiness

The assertions now track semantic state, not fragile text placement. Navigation is target-based instead of order-based, so Windows/non-Windows row differences and harmless popup layout changes no longer break the tests. That removes the scheduler- and platform-sensitive assumptions that made the popup suite intermittent.

Co-authored-by: Codex <noreply@openai.com>
@aibrahim-oai aibrahim-oai enabled auto-merge (squash) March 17, 2026 19:58
@aibrahim-oai aibrahim-oai merged commit 23a44dd into main Mar 17, 2026
33 checks passed
@aibrahim-oai aibrahim-oai deleted the codex/permissions-popup-selection-stability branch March 17, 2026 20:45
@github-actions github-actions bot locked and limited conversation to collaborators Mar 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants