Skip to content

Flakiness in testing for restricted course tabs #374

Open
@smartspot2

Description

See the following for error logs:

When switching between tabs in the test, it seems like there is an update to the restricted tab in a later re-rendering of the component. In particular, by design we want to default to the restricted courses tab if the user is whitelisted for any restricted courses, but we want to default to unrestricted courses otherwise. This processing of the courses data causes a delay before swapping to the restricted courses upon page load, meaning the click gets overridden, failing the test.

A dirty (and discouraged) fix would be to add a cy.wait before clicking the tab, though a better solution would be to try remove this rendering delay, so that it's impossible for a user click to be overridden by the re-rendering. However, this is a very hard thing to test for, as reproducing this bug is incredibly difficult locally; it all depends on the load time and rendering time of the webpage.

Additionally, these observations could be wrong and not the source of the error—it shouldn't be a Cypress issue (as 8a9a74b fixes all the Cypress retry errors, and the Cypress logs show it waited for 4s before timing out), but it could be caused by something else.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsev5Low severity - General guidance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions