fix(ui): fix flaky selectNamespace race condition in cypress test#2664
fix(ui): fix flaky selectNamespace race condition in cypress test#2664jonburdo wants to merge 1 commit intokubeflow:mainfrom
Conversation
Wait for the namespace dropdown button to be enabled before clicking, removing force:true which bypassed actionability checks and caused intermittent failures when the namespace API response hadn't arrived yet. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Jon Burdo <jon@jonburdo.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
This PR hardens the Cypress page-object helpers around the namespace dropdown in the Model Registry “Register model” flow to eliminate timing-related flakiness when namespaces haven’t loaded yet.
Changes:
- Wait for the namespace select control to be enabled before interacting with it.
- Remove
click({ force: true })so Cypress actionability checks are respected. - Add an explicit assertion that the dropdown listbox is visible before selecting an option.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/cc @manaswinidas @ppadti Does this seem reasonable? |
Wait for the namespace dropdown button to be enabled before clicking, removing force:true which bypassed actionability checks and caused intermittent failures when the namespace API response hadn't arrived yet.
Description
selectNamespaceandshouldHaveNamespaceOptionsuseclick({ force: true }), which bypasses Cypress's actionability checks. When the namespace API response hasn't arrived yet, the dropdown button is disabled (isDisabled={namespaces.length === 0}), butforce: trueclicks it anyway — no options render, and the test times out looking forrole="option"elements.This is timing-dependent: it only fails when the page takes slightly longer to load (e.g., after a preceding test navigates away from the register page).
All four failures produce the same error:
failures
Three failures across unrelated commits spanning a month:
3088da288f5d78036eb25cfbevidence this is a flaky test
Run 25053512145 on commit
d911da74— identical code, identical CI, different results:selectNamespace— 1 failing, 381 passingFix
.should('not.be.disabled'))force: trueso Cypress respects normal actionability checksTested locally
To ensure it doesn't break anything, I made sure this still passes:
How Has This Been Tested?
Merge criteria:
DCOcheck)ok-to-testhas been added to the PR.If you have UI changes