Page MenuHomeSoftware Heritage

cypress/origin-search: Try to fix failing test on Jenkins
ClosedPublic

Authored by anlambert on Jan 6 2020, 5:10 PM.

Details

Summary

We have a cypress test that often fails on Jenkins:

────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running:  origin-search.spec.js                                                         (12 of 17)


  Test origin-search
    ✓ should show in result when url is searched (2643ms)
    ✓ should show not found message when no repo matches (798ms)
    ✓ should add appropriate URL parameters (1110ms)
    Test pagination
      ✓ should not paginate if there are not many results (1039ms)
      ✓ should paginate forward when there are many results (14122ms)
      ✓ should paginate backward from a middle page (3133ms)
      ✓ should paginate backward from the last page (16841ms)
[2515:1220/155811.693808:FATAL:memory.cc(22)] Out of memory. size=262144
We detected that the Chromium Renderer process just crashed.

This is the equivalent to seeing the 'sad face' when Chrome dies.

This can happen for a number of different reasons:

- You wrote an endless loop and you must fix your own code
- There is a memory leak in Cypress (unlikely but possible)
- You are running Docker (there is an easy fix for this: see link below)
- You are running lots of tests on a memory intense application
- You are running in a memory starved VM environment
- There are problems with your GPU / GPU drivers
- There are browser bugs in Chromium

You can learn more including how to fix Docker here:

https://on.cypress.io/renderer-process-crashed

  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        0                                                                                │
  │ Passing:      0                                                                                │
  │ Failing:      1                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  0                                                                                │
  │ Video:        false                                                                            │
  │ Duration:     0 seconds                                                                        │
  │ Spec Ran:     origin-search.spec.js                                                            │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘

Let's try to make it pass without touching any docker configuration.

Update: I guess my intuition was right. Stubbing the XHR requests checking the latest origin visits and waiting for them before continuing the tests seems to fix the long running time and the high memory usage. I executed the Jenkins job four times for this diff and no more failing test (see https://jenkins.softwareheritage.org/job/DWAPPS/job/cypress-diff/).

Diff Detail

Repository
rDWAPPS Web applications
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

anlambert created this revision.Jan 6 2020, 5:10 PM
anlambert retitled this revision from cypress/origin-search: Try to fix failing test on Jenkins (WIP) to cypress/origin-search: Try to fix failing test on Jenkins.Jan 6 2020, 5:56 PM
anlambert edited the summary of this revision. (Show Details)
vlorentz accepted this revision.Jan 6 2020, 6:00 PM
This revision is now accepted and ready to land.Jan 6 2020, 6:00 PM
anlambert updated this revision to Diff 8879.Jan 6 2020, 6:08 PM

Update commit message

This revision was automatically updated to reflect the committed changes.