Skip to content

Commit

Permalink
Reduce flakiness in explorer/apps/repositories.spec.ts (rancher#12445)
Browse files Browse the repository at this point in the history
* fix aftereach hook in explorer apps test

* tweak explorer repo clean up logic

* fix linting errors
  • Loading branch information
mantis-toboggan-md authored Dec 19, 2024
1 parent 4dd926c commit ed0c829
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cypress/e2e/tests/pages/explorer/apps/repositories.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ describe('Apps', () => {

// Ensure this runs after an attempt, rather than all attemps (`after` only runs once after all cypress retries)
afterEach(() => {
reposToDelete.forEach((r) => cy.deleteRancherResource('v1', 'catalog.cattle.io.clusterrepos', r));
for (const repo of reposToDelete) {
cy.deleteRancherResource('v1', 'catalog.cattle.io.clusterrepos', repo, false).then((res: Cypress.Response<any>) => {
if (res.status === 201) {
reposToDelete.splice(reposToDelete.indexOf(repo), 1);
}
});
}
});
});

Expand Down

0 comments on commit ed0c829

Please sign in to comment.