Skip to content

Improve Cypress teardown#7745

Open
martinjagodic wants to merge 2 commits intomainfrom
cypress-teardown
Open

Improve Cypress teardown#7745
martinjagodic wants to merge 2 commits intomainfrom
cypress-teardown

Conversation

@martinjagodic
Copy link
Member

Tests are hanging for no apparent reason. This PR will solve it hopefully. For now I added some logging to identify the problem.

Also reduces timeout from 1hr to 30 min.

@martinjagodic martinjagodic requested a review from a team as a code owner March 5, 2026 14:09
@yanthomasdev
Copy link
Contributor

Tests are hanging for no apparent reason.

I think it might be related to GitHub itself, there's some ungoing issues with Actions, I'll see if there's any issues happening locally

image

Comment on lines +39 to +40
console.log(`Starting teardown for: ${spec} - ${testName}`);
const startTime = Date.now();
Copy link
Contributor

Choose a reason for hiding this comment

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

This might not be super consistent, that will be executed with the function, but not exactly the moment Cypress starts teardown because of its queue system.

Maybe something like this workarounds this matter? But again, not really something that would make a big difference, I believe.

Suggested change
console.log(`Starting teardown for: ${spec} - ${testName}`);
const startTime = Date.now();
let startTime;
cy.then(() => {
startTime = Date.now();
console.log(`Starting teardown for: ${spec} - ${testName}`);
});

Copy link
Contributor

@yanthomasdev yanthomasdev left a comment

Choose a reason for hiding this comment

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

Looks good to me, I have a small nit but not blocking.

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