Skip to content

Commit

Permalink
chore: Increase the cypress default command timeout to 20s (#2068)
Browse files Browse the repository at this point in the history
## Description:
This PR increases the default command timeout in cypress in an attempt
to address flakey tests reported by @h4ck3rk3y on slack.

Examples of flakey runs:
*
https://app.circleci.com/pipelines/github/kurtosis-tech/kurtosis/10765/workflows/2d6e411a-d6b9-472b-9495-1ea69b304402/jobs/154148
*
https://app.circleci.com/pipelines/github/kurtosis-tech/kurtosis/10773/workflows/4a2b122f-bdda-48f1-b4f3-df29ae021949/jobs/154294
*
https://app.circleci.com/pipelines/github/kurtosis-tech/kurtosis/10755/workflows/f9e01095-678e-498c-94b9-ce47bfe771bd/jobs/154037
*
https://app.circleci.com/pipelines/github/kurtosis-tech/kurtosis/10751/workflows/d9757f39-b633-4996-81a5-462cb21ebc5c/jobs/153944

Looking at these it seems another common thread is that the enclave list
test is flakey at an unknown point - specifically some promise exception
can be thrown. I think this is probably in the log viewer - and not
actually indicative of the test failing. For this reason I've disabled
the unhandled promise exception failures in this pr.

## Is this change user facing?
NO

## References (if applicable):
*
https://docs.cypress.io/guides/core-concepts/retry-ability#Increase-time-to-retry
*
https://docs.cypress.io/guides/references/configuration#Overriding-Options
  • Loading branch information
Dartoxian committed Jan 22, 2024
1 parent 8a0241f commit d389763
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions enclave-manager/web/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineConfig } from "cypress";

export default defineConfig({
e2e: {
defaultCommandTimeout: 20000,
setupNodeEvents(on, config) {
// implement node event listeners here
},
Expand Down
2 changes: 1 addition & 1 deletion enclave-manager/web/cypress/e2e/enclaveList.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe("Enclave List", () => {
cy.contains("button", "Edit").click();
cy.focusInputWithLabel("Max CPU").type("1024");
cy.contains("button", "Update").click();
cy.contains("Script completed", { timeout: 10 * 1000 });
cy.contains("Script completed", { timeout: 30 * 1000 });
});

it("Shows a new enclave in the list", () => {
Expand Down
8 changes: 8 additions & 0 deletions enclave-manager/web/cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,11 @@ import "./commands";

// Alternatively you can use CommonJS syntax:
// require('./commands')

Cypress.on("uncaught:exception", (err, runnable, promise) => {
// Log streaming seems to occasionally close unexpectedly, causing a promise exception to be thrown.
// Because of this we shouldn't fail tests when this happens.
if (promise) {
return false;
}
});

0 comments on commit d389763

Please sign in to comment.