Page MenuHomeSoftware Heritage

Fix flaky cypress tests
Closed, MigratedEdits Locked

Description

Some cypress tests are flaky which is annoying as Jenkins builds for swh-web need to be trigger again to get a green light, and cypress tests are so slow to execute compared to Python ones.

Below are the tests that need to be fixed (I am sure of these ones, will amend that task each time I encountered a new one I forgot about):

14:36:48    1) Test Diffs View
14:36:48         should highlight diff lines properly when a content is browsed in the Files tab:
14:36:48       TypeError: Cannot read property 'top' of undefined
14:36:48        at Context.eval (http://localhost:5004/__cypress/tests?p=cypress/integration/revision-diff.spec.js:254:31)
10:28:32    1) Vault Cooking User Interface Tests
10:28:32         should create a revision cooking task and report its status:
10:28:32       CypressError: Timed out retrying after 20000ms: `cy.wait()` timed out waiting `20000ms` for the 4th request to the route: `checkVaultCookingTask`. No request ever occurred.
10:28:32  
10:28:32  https://on.cypress.io/wait
10:28:32        at cypressErr (http://localhost:5004/__cypress/runner/cypress_runner.js:153726:18)
10:28:32        at Object.errByPath (http://localhost:5004/__cypress/runner/cypress_runner.js:153795:10)
10:28:32        at checkForXhr (http://localhost:5004/__cypress/runner/cypress_runner.js:140737:33)
10:28:32        at http://localhost:5004/__cypress/runner/cypress_runner.js:140760:28
10:28:32        at tryCatcher (http://localhost:5004/__cypress/runner/cypress_runner.js:10791:23)
10:28:32        at Function.Promise.attempt.Promise.try (http://localhost:5004/__cypress/runner/cypress_runner.js:8065:29)
10:28:32        at tryFn (http://localhost:5004/__cypress/runner/cypress_runner.js:146634:21)
10:28:32        at whenStable (http://localhost:5004/__cypress/runner/cypress_runner.js:146672:12)
10:28:32        at http://localhost:5004/__cypress/runner/cypress_runner.js:146164:16
10:28:32        at tryCatcher (http://localhost:5004/__cypress/runner/cypress_runner.js:10791:23)
10:28:32        at Promise._settlePromiseFromHandler (http://localhost:5004/__cypress/runner/cypress_runner.js:8726:31)
10:28:32        at Promise._settlePromise (http://localhost:5004/__cypress/runner/cypress_runner.js:8783:18)
10:28:32        at Promise._settlePromise0 (http://localhost:5004/__cypress/runner/cypress_runner.js:8828:10)
10:28:32        at Promise._settlePromises (http://localhost:5004/__cypress/runner/cypress_runner.js:8908:18)
10:28:32        at Promise._fulfill (http://localhost:5004/__cypress/runner/cypress_runner.js:8852:18)
10:28:32        at http://localhost:5004/__cypress/runner/cypress_runner.js:10466:46
10:28:32    From Your Spec Code:
10:28:32        at Context.eval (http://localhost:5004/__cypress/tests?p=cypress/integration/vault.spec.js:148:12)
09:42:18    1) Test origin-search
09:42:18         Test invalid SWHIDs
09:42:18           should show not found for content:
09:42:18       AssertionError: Timed out retrying after 20000ms: expected '<div.invalid-feedback>' to be 'visible'
09:42:18  
09:42:18  This element `<div.invalid-feedback>` is not visible because it has CSS property: `display: none`
09:42:18        at searchShouldShowNotFound (http://localhost:5004/__cypress/tests?p=cypress/integration/origin-search.spec.js:134:33)
09:42:18        at Context.eval (http://localhost:5004/__cypress/tests?p=cypress/integration/origin-search.spec.js:426:7)
09:33:13    1) Vault Cooking User Interface Tests
09:33:13         should create a directory cooking task and report the success:
09:33:13  
09:33:13        Timed out retrying after 20000ms
09:33:13        + expected - actual
09:33:13  
09:33:13        -'rgba(128, 128, 128, 0.5)'
09:33:13        +'rgba(0, 0, 255, 0.5)'
09:33:13        
09:33:13        at testStatus (http://localhost:5004/__cypress/tests?p=cypress/integration/vault.spec.js:143:116)
09:33:13        at Context.eval (http://localhost:5004/__cypress/tests?p=cypress/integration/vault.spec.js:260:9)
09:33:13  
09:33:13    2) Vault Cooking User Interface Tests
09:33:13         should create a revision cooking task and report its status:
09:33:13       AssertionError: Timed out retrying after 20000ms: Expected to find element: `.swh-vault-table #vault-task-1c480a4573d2a003fc2630c21c2b25829de49972`, but never found it.
09:33:13        at testStatus (http://localhost:5004/__cypress/tests?p=cypress/integration/vault.spec.js:143:52)
09:33:13        at Context.eval (http://localhost:5004/__cypress/tests?p=cypress/integration/vault.spec.js:312:9)