Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Resolve Linode/Firewall E2E flake by using alternative security method #10581

Merged

Conversation

jdamore-linode
Copy link
Contributor

Description 📝

Since merging #10538, a few of our tests have become especially flaky. This appears to be caused by an API issue where the API responds with 400 Linode busy when performing some actions on Linodes that are attached to Firewalls. This happens most often when attempting to interact with a Linode that has just finished booting.

See also #10580, which makes this issue more reproducible for troubleshooting/exploration purposes.

Changes 🔄

  • Avoid attaching Firewalls to Linodes in impacted tests, disabling internet access instead
  • Increase clone test timeout (disabling internet access requires the Linode to have an image, which causes the clone operation to be slower)

How to test 🧪

We can rely on CI for this. Ideally all of the identified tests will pass without any flake.

To run the tests locally, use this command:

yarn cy:run -s "cypress/e2e/core/linodes/rescue-linode.spec.ts,cypress/e2e/core/linodes/resize-linode.spec.ts,cypress/e2e/core/linodes/linode-config.spec.ts,cypress/e2e/core/linodes/switch-linode-state.spec.ts,cypress/e2e/core/linodes/clone-linode.spec.ts"

As an Author I have considered 🤔

Check all that apply

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

@jdamore-linode jdamore-linode self-assigned this Jun 13, 2024
@jdamore-linode jdamore-linode requested a review from a team as a code owner June 13, 2024 19:49
@jdamore-linode jdamore-linode requested review from cliu-akamai and removed request for a team June 13, 2024 19:49
@jdamore-linode jdamore-linode requested a review from a team as a code owner June 13, 2024 19:51
@jdamore-linode jdamore-linode requested review from abailly-akamai and AzureLatte and removed request for a team June 13, 2024 19:51
Copy link

github-actions bot commented Jun 13, 2024

Coverage Report:
Base Coverage: 82.84%
Current Coverage: 82.84%

@@ -33,6 +33,9 @@ const getLinodeCloneUrl = (linode: Linode): string => {
return `/linodes/create?linodeID=${linode.id}${regionQuery}&type=Clone+Linode${typeQuery}`;
};

/* Timeout after 3 seconds while waiting for clone. */
const CLONE_TIMEOUT = 180_000;
Copy link
Contributor

Choose a reason for hiding this comment

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

Does a timeout nulls the assertion or does the the test fails after an extra 3s if unfillfilled?

Am asking cause it feels a bit like an unreliable bandage and wondering if there's a better way to do this. If I am not wrong we're waiting for an async action, an API event triggering a snackbar notification? Wondering if it could help to intercept events and wait for a particular action payload (thinking out loud!)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry -- that comment should say 3 minutes 😅

The test will fail if the clone toast doesn't appear within 3 minutes. Every Cypress command has a timeout where the test will fail if the assertion isn't met, and in this case I had to increase the default timeout of cy.contains() because the clone operation now takes longer now that the Linode we're cloning has an image.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh ok that makes more sense, also i should've done the math 🤣

Copy link
Contributor

@AzureLatte AzureLatte left a comment

Choose a reason for hiding this comment

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

Test passed

@jdamore-linode jdamore-linode merged commit ca19099 into linode:develop Jun 17, 2024
18 checks passed
nikhagra-akamai pushed a commit to nikhagra-akamai/manager that referenced this pull request Jun 19, 2024
… method (linode#10581)

* Work around Linode/Firewall flake by using alternative security method

* Added changeset: Fix Linode/Firewall related E2E test flake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants