Skip to content

Fix an e2e flake, maybe: use fillNumberInput#3265

Merged
david-crespo merged 1 commit into
mainfrom
fix-firewall-flake
Jun 26, 2026
Merged

Fix an e2e flake, maybe: use fillNumberInput#3265
david-crespo merged 1 commit into
mainfrom
fix-firewall-flake

Conversation

@david-crespo

Copy link
Copy Markdown
Collaborator

Saw a flake in https://github.com/oxidecomputer/console/actions/runs/28251857097/job/83705140277, sicced the robot on it. Unfortunately it was not able to repro the flake locally, but it seems plausible anyway.

🤖 Summary

Flake: firewall-rules.e2e.ts › can create firewall rule (firefox)

Root cause. The test typed 5 into the Priority field, but the rule was created with Priority: "0" (the default) — failing all 3 retries with:

Expected: ...{"Priority": "5", ...}
Received: ...{"Priority": "0", ...}

The Priority field is a React Aria NumberInput, which can drop a value set via plain page.fill() when the form re-renders before the edit commits. The codebase already documents this exact race and has a helper for it: fillNumberInput (test/e2e/utils.ts:68), which clicks, fills, blurs, and polls until the value sticks.

The old call also used the deprecated legacy string-selector syntax ('role=textbox[name="Priority"]') that CLAUDE.md discourages.

Fix. Swapped both raw Priority fills in the file to use fillNumberInput:

  • line 44 (can create firewall rule, the one that flaked) — '5'
  • line 586 (name conflict error on edit, same NumberInput risk) — '37'

Verification. The flake didn't reproduce locally in 15 runs (it needs CI's heavier parallel load), but the error is unambiguous and the fix matches the established pattern. After the change, both affected tests passed 20/20 on firefox; lint clean.

The fix is committed as its own rev (b8c7d432) on top of main for you to review/squash.

The Priority field is a React Aria NumberInput, which can drop a value
filled via plain fill() if the form re-renders before the edit commits.
This surfaced in CI as 'can create firewall rule' creating a rule with
Priority 0 instead of 5. Use the existing fillNumberInput helper, which
blurs and polls until the value sticks.
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
console Ready Ready Preview Jun 26, 2026 5:29pm

Request Review

@charliepark charliepark left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems reasonable. We might also do a 'role=textbox[name="…page.getByRole… migration (separately) in the rest of the codebase once this is in. Or migrating other fillNumberInputs if we think other tests might be flakey.

@david-crespo david-crespo merged commit 823e5b2 into main Jun 26, 2026
7 checks passed
@david-crespo david-crespo deleted the fix-firewall-flake branch June 26, 2026 18:55
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.

2 participants