https://cypress.io logo
cypress 12.5.1 is very slow in ADO pipeline
# i-need-help
c
Hi there, We've upgrade to 12.5.1 and noticed that our build agents (each have 4vCPUs with 8GB of RAM) run cypress tests 2-3x slower when
video: true
versus
video: false
in the cypress config. Moreover, I'm having a hard time diagnosing/debugging whether the agents are under-resourced, or perhaps the thing slowing down our tests are DNS-resolution/networking errors. Can anyone advise? using cypress@12.5.1 with typescript and the following config:
Copy code
typescript
import registerCypressGrep from '@cypress/grep/src/plugin';
import { defineConfig } from 'cypress';
import dotenvPlugin from 'cypress-dotenv';

// eslint-disable-next-line import/no-default-export
export default defineConfig({
  video: false,
  trashAssetsBeforeRuns: true,
  // numTestsKeptInMemory: 5,
  pageLoadTimeout: 60_000,
  videoUploadOnPasses: false,
  videoCompression: 16,
  e2e: {
    // eslint-disable-next-line @typescript-eslint/naming-convention
    setupNodeEvents(_on, config) {
      // implement node event listeners here
      config = dotenvPlugin(config, { debug: true }, true);
      registerCypressGrep(config);
      return config;
    },
  },
  reporter: 'cypress-multi-reporters',
  reporterOptions: {
    reporterEnabled: 'spec, mocha-junit-reporter',
    mochaJunitReporterReporterOptions: {
      mochaFile: 'cypress/results/results-[hash].xml',
    },
  },
});
p
are you using the cypress pre-built docker images? https://github.com/cypress-io/cypress-docker-images
c
nah, I'm installing via
npm ci
our agents don't have access to GPUs, and I'm wondering if that's why
video: true
is so much slower than
video: false
moreover, I'm trying to understand how we can configure cypress to set
video: true
and not balloon our test times
Here's some agent info:
output from `node -p 'os.cpus()'`:
Copy code
[
  {
    model: 'Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz',
    speed: 2593,
    times: { user: 98890, nice: 5550, sys: 45210, idle: 2636230, irq: 0 }
  },
  {
    model: 'Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz',
    speed: 2593,
    times: { user: 102730, nice: 4600, sys: 51960, idle: 2591190, irq: 0 }
  },
  {
    model: 'Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz',
    speed: 2593,
    times: { user: 98470, nice: 3220, sys: 51790, idle: 2532840, irq: 0 }
  },
  {
    model: 'Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz',
    speed: 2593,
    times: { user: 102000, nice: 6260, sys: 48390, idle: 2575770, irq: 0 }
  }
]
output from `npx cypress info`:
Copy code
[41067:0208/143100.569053:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
Displaying Cypress info...

Detected 2 browsers installed:
2. Chromium
  - Name: chromium
  - Channel: stable
  - Version: 102.0.5005.0
  - Executable: chromium-browser

Note: to run these browsers, pass <name>:<channel> to the '--browser' field

Examples:
- cypress run --browser chromium
- cypress run --browser chrome

Learn More: https://on.cypress.io/launching-browsers

Proxy Settings: none detected
Environment Variables:
CYPRESS_PROJECT_ID: 3b281n
CYPRESS_RECORD_KEY: <redacted>

Application Data: /home/AzDevOps/.config/cypress/cy/development
Browser Profiles: /home/AzDevOps/.config/cypress/cy/development/browsers
Binary Caches: /home/AzDevOps/.cache/Cypress

Cypress Version: 12.5.1 (stable)
System Platform: linux (Ubuntu - 22.04)
System Memory: 16.8 GB free 15.4 GB
for some comparison, the test I'm using to benchmark takes about 1:40 with
video: false
and 3:37 with
video: true
. (and often
video: true
leads to such slow performance, tests fail)
m
Hi, Has anyone faced an issue while running the Cypress test using Docker on an Apple M1 chip ( For Chrome and Firefox Browsers)? It works fine while running locally without using Docker but with Docker, passing browsers (Chrome / Firefox) throws an error.
a
@miniature-window-79139 we're waiting on chrome/firefox and edge to release m1 packages of their browsers for us to include in our docker images. You'll need to run in Electron for now. You can see this GH issue for details: https://github.com/cypress-io/cypress-docker-images/issues/864
@colossal-oxygen-29599
video:true
requires additional time to compress and process every video. My recommendation would be to remove any video options from your
cypress.config
and instead add the option to upload video specs conditionally if your team would like to videos of failed/flaky tests: https://docs.cypress.io/api/plugins/after-spec-api#Delete-the-recorded-video-if-the-spec-passed https://docs.cypress.io/api/plugins/after-spec-api#Delete-the-recorded-video-if-no-tests-retried
c
It turns out we had a hypervisor issue
And upgrading our agents helped massively
Nowadays our biggest issues are connectivity -- we have a constellation of microservices and intercepting the calls has become a source of test failures
a
You read my mind. I was going to say that 2BG wasn't enough
I'm glad you were able to resolve the first issue. Go ahead and start a new thread to hopefully get some eyes on the connectivity issue. Unfortunately, that's not really my area of expertise.