Skip to content

Commit

Permalink
misc: suppress more GPU related warnings (#30861)
Browse files Browse the repository at this point in the history
Closes Mesa/GLX related warnings shown when running Cypress #29521

The primary Cypress process can emit benign warnings related to Mesa/GLX when running in certain Linux environments or containers. These warnings are related to graphics drivers and X11 display settings, but are not necessary for Cypress to execute correctly. This PR suppresses these warnings from stdout, similar to other benign Electron warnings:

- `error: XDG_RUNTIME_DIR is invalid or not set in the environment.`
- `MESA: error: ZINK: failed to choose pdev`
- `glx: failed to create drisw screen`

1. Execute Cypress tests in run mode on a Linux machine or container with minimal graphics drivers installed
2. Execute Cypress tests in run mode in a Docker container using a basic Linux image (e.g. ubuntu:latest)
3. Verify the suppressed warnings no longer appear in the terminal output

Users will no longer see benign graphics-related warnings in their terminal output when running Cypress in Linux environments with minimal graphics support. This reduces noise in the terminal output while not affecting any actual test functionality.

- [x] Have tests been added/updated?
- [NA] Has a PR for user-facing changes been opened in cypress-documentation?
- [NA] Have API changes been updated in the type definitions?

fix linting
change word for CI

Update cli/CHANGELOG.md

Going with the suggesting.

Co-authored-by: Mike McCready <[email protected]>

fix linting

update readme with another fixed issue

Co-authored-by: Jennifer Shehane <[email protected]>
  • Loading branch information
d4v3y0rk and jennifer-shehane authored Jan 23, 2025
1 parent 92e428a commit 222da94
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
6 changes: 5 additions & 1 deletion cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ _Released 1/28/2025 (PENDING)_

- Fixed an issue where Cypress would incorrectly navigate to `about:blank` when test isolation was disabled and the last test would fail and then retry. Fixes [#28527](https://github.com/cypress-io/cypress/issues/28527).

**Misc:**

- Benign Mesa/GLX related warnings are now hidden in the terminal output when running Cypress in certain Linux environments or containers. Addresses [#29521](https://github.com/cypress-io/cypress/issues/29521) and [#29554](https://github.com/cypress-io/cypress/issues/29554).

## 14.0.0

_Released 1/16/2025_
Expand All @@ -20,7 +24,7 @@ _Released 1/16/2025_
- The `cy.origin()` command must now be used when navigating between subdomains. Because this is a fairly disruptive change for users who frequently navigate between subdomains, a new configuration option is being introduced. `injectDocumentDomain` can be set to `true` in order to re-enable the injection of `document.domain` by Cypress. This configuration option is marked as deprecated and you will receive a warning when Cypress is launched with this option set to `true`. It will be removed in Cypress 15. Addressed in [#30770](https://github.com/cypress-io/cypress/pull/30770). Addresses [#25806](https://github.com/cypress-io/cypress/issues/25806), [#25987](https://github.com/cypress-io/cypress/issues/25987), [#27528](https://github.com/cypress-io/cypress/issues/27528), [#29445](https://github.com/cypress-io/cypress/issues/29445), [#29590](https://github.com/cypress-io/cypress/issues/29590) and [#30571](https://github.com/cypress-io/cypress/issues/30571).
- It is no longer possible to make a `fetch` or `XMLHttpRequest` request from the `about:blank` page in Electron (i.e. `cy.window().then((win) => win.fetch('<some-url>'))`). You must use `cy.request` instead or perform some form of initial navigation via `cy.visit()`. Addressed in [#30394](https://github.com/cypress-io/cypress/pull/30394).
- The `experimentalJustInTimeCompile` configuration option for component testing has been replaced with a `justInTimeCompile` option that is `true` by default. This option will only compile resources directly related to your spec, compiling them 'just-in-time' before spec execution. This should result in improved memory management and performance for component tests in `cypress open` and `cypress run` modes, in particular for large component testing suites. `justInTimeCompile` is now only supported for [`webpack`](https://www.npmjs.com/package/webpack). Addresses [#30234](https://github.com/cypress-io/cypress/issues/30234). Addressed in [#30641](https://github.com/cypress-io/cypress/pull/30641).
- Cypress Component Testing no longer supports:
- Cypress Component Testing no longer supports:
- `create-react-app`. Addresses [#30028](https://github.com/cypress-io/cypress/issues/30028).
- `@vue/cli-service`. Addresses [#30481](https://github.com/cypress-io/cypress/issues/30481).
- `Angular` versions 13, 14, 15, and 16. The minimum supported version is now `17.2.0` in order to fully support Angular [signals](https://angular.dev/guide/signals). Addresses [#29582](https://github.com/cypress-io/cypress/issues/29582). Addressed in [#30539](https://github.com/cypress-io/cypress/pull/30539).
Expand Down
28 changes: 27 additions & 1 deletion cli/lib/exec/spawn.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,33 @@ const isDebugScenario4 = /^\[[^\]]+debug_utils\.cc[^\]]+\] Hit debug scenario: 4
*/
const isEGLDriverMessage = /^\[[^\]]+gl_display\.cc[^\]]+\] EGL Driver message \(Error\) eglQueryDeviceAttribEXT: Bad attribute\./

const GARBAGE_WARNINGS = [isXlibOrLibudevRe, isHighSierraWarningRe, isRenderWorkerRe, isDbusWarning, isCertVerifyProcBuiltin, isHostVulkanDriverWarning, isContainerVulkanDriverWarning, isContainerVulkanStack, isDebugScenario4, isEGLDriverMessage]
/**
* Mesa/GLX related warnings that occur in certain Linux environments without proper GPU support
* or when running in containers. These are benign warnings that don't affect functionality.
* Samples:
* error: XDG_RUNTIME_DIR is invalid or not set in the environment.
* MESA: error: ZINK: failed to choose pdev
* glx: failed to create drisw screen
*/
const isXdgRuntimeError = /^error: XDG_RUNTIME_DIR is invalid or not set/
const isMesaZinkError = /^MESA: error: ZINK: failed to choose pdev/
const isGlxDriverError = /^glx: failed to create drisw screen/

const GARBAGE_WARNINGS = [
isXlibOrLibudevRe,
isHighSierraWarningRe,
isRenderWorkerRe,
isDbusWarning,
isCertVerifyProcBuiltin,
isHostVulkanDriverWarning,
isContainerVulkanDriverWarning,
isContainerVulkanStack,
isDebugScenario4,
isEGLDriverMessage,
isXdgRuntimeError,
isMesaZinkError,
isGlxDriverError,
]

const isGarbageLineWarning = (str) => {
return _.some(GARBAGE_WARNINGS, (re) => {
Expand Down
14 changes: 13 additions & 1 deletion cli/test/lib/exec/spawn_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe('lib/exec/spawn', function () {
at Initialize (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:344)
at Create (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:266)
at operator() (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:521)
[78887:1023/114920.074882:ERROR:debug_utils.cc(14)] Hit debug scenario: 4
[18489:0822/130231.159571:ERROR:gl_display.cc(497)] EGL Driver message (Error) eglQueryDeviceAttribEXT: Bad attribute.
Expand All @@ -112,6 +112,18 @@ describe('lib/exec/spawn', function () {
expect(spawn.isGarbageLineWarning(line), `expected line to be garbage: ${line}`).to.be.true
})
})

it('returns true for XDG runtime dir warnings', () => {
expect(spawn.isGarbageLineWarning('error: XDG_RUNTIME_DIR is invalid or not set')).to.be.true
})

it('returns true for MESA ZINK errors', () => {
expect(spawn.isGarbageLineWarning('MESA: error: ZINK: failed to choose pdev')).to.be.true
})

it('returns true for GLX driver errors', () => {
expect(spawn.isGarbageLineWarning('glx: failed to create drisw screen')).to.be.true
})
})

context('.start', function () {
Expand Down

5 comments on commit 222da94

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 222da94 Jan 23, 2025

Choose a reason for hiding this comment

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

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/14.0.1/linux-x64/develop-222da94e2d5cc890dd65ad35fb211324b3e0b916/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 222da94 Jan 23, 2025

Choose a reason for hiding this comment

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

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/14.0.1/linux-arm64/develop-222da94e2d5cc890dd65ad35fb211324b3e0b916/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 222da94 Jan 23, 2025

Choose a reason for hiding this comment

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

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/14.0.1/win32-x64/develop-222da94e2d5cc890dd65ad35fb211324b3e0b916/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 222da94 Jan 23, 2025

Choose a reason for hiding this comment

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

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/14.0.1/darwin-arm64/develop-222da94e2d5cc890dd65ad35fb211324b3e0b916/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 222da94 Jan 24, 2025

Choose a reason for hiding this comment

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

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/14.0.1/darwin-x64/develop-222da94e2d5cc890dd65ad35fb211324b3e0b916/cypress.tgz

Please sign in to comment.