Skip to content

Commit 2688cbd

Browse files
committed
misc: suppress more GPU related warnings
Closes Mesa/GLX related warnings shown when running Cypress #29521 ### Additional details 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` ### Steps to test 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 ### How has the user experience changed? 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. ### PR Tasks - [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?
1 parent 107d3ed commit 2688cbd

File tree

3 files changed

+49
-3
lines changed

3 files changed

+49
-3
lines changed

cli/CHANGELOG.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ _Released 1/7/2024 (PENDING)_
1212
- 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).
1313
- 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 [#29547](https://github.com/cypress-io/cypress/pull/30394).
1414
- 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 [#30402](https://github.com/cypress-io/cypress/pull/30402).
15-
- Cypress Component Testing no longer supports:
15+
- Cypress Component Testing no longer supports:
1616
- `create-react-app`. Addresses [#30028](https://github.com/cypress-io/cypress/issues/30028).
1717
- `@vue/cli-service`. Addresses [#30481](https://github.com/cypress-io/cypress/issues/30481).
1818
- `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).
@@ -60,6 +60,11 @@ in this [GitHub issue](https://github.com/cypress-io/cypress/issues/30447). Addr
6060

6161
- Removed some component testing API stubs that were removed in [Cypress v11.0.0](https://docs.cypress.io/app/references/migration-guide#Component-Testing-Updates). Addressed in [#30696](https://github.com/cypress-io/cypress/pull/30696). Addresses [#30623](https://github.com/cypress-io/cypress/issues/30623).
6262
- Updated to use Cypress design system browser icons. Addressed in [#30790](https://github.com/cypress-io/cypress/pull/30790).
63+
- Fixed an issue where benign Mesa/GLX related warnings were being shown in the terminal output when running Cypress in certain Linux environments or containers. The following warnings are now suppressed:
64+
- `error: XDG_RUNTIME_DIR is invalid or not set in the environment.`
65+
- `MESA: error: ZINK: failed to choose pdev`
66+
- `glx: failed to create drisw screen`
67+
Fixes [#29521](https://github.com/cypress-io/cypress/issues/29521)
6368

6469
**Dependency Updates:**
6570

cli/lib/exec/spawn.js

+27-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,33 @@ const isDebugScenario4 = /^\[[^\]]+debug_utils\.cc[^\]]+\] Hit debug scenario: 4
8484
*/
8585
const isEGLDriverMessage = /^\[[^\]]+gl_display\.cc[^\]]+\] EGL Driver message \(Error\) eglQueryDeviceAttribEXT: Bad attribute\./
8686

87-
const GARBAGE_WARNINGS = [isXlibOrLibudevRe, isHighSierraWarningRe, isRenderWorkerRe, isDbusWarning, isCertVerifyProcBuiltin, isHostVulkanDriverWarning, isContainerVulkanDriverWarning, isContainerVulkanStack, isDebugScenario4, isEGLDriverMessage]
87+
/**
88+
* Mesa/GLX related warnings that occur in certain Linux environments without proper GPU support
89+
* or when running in containers. These are benign warnings that don't affect functionality.
90+
* Samples:
91+
* error: XDG_RUNTIME_DIR is invalid or not set in the environment.
92+
* MESA: error: ZINK: failed to choose pdev
93+
* glx: failed to create drisw screen
94+
*/
95+
const isXdgRuntimeError = /^error: XDG_RUNTIME_DIR is invalid or not set/
96+
const isMesaZinkError = /^MESA: error: ZINK: failed to choose pdev/
97+
const isGlxDriverError = /^glx: failed to create drisw screen/
98+
99+
const GARBAGE_WARNINGS = [
100+
isXlibOrLibudevRe,
101+
isHighSierraWarningRe,
102+
isRenderWorkerRe,
103+
isDbusWarning,
104+
isCertVerifyProcBuiltin,
105+
isHostVulkanDriverWarning,
106+
isContainerVulkanDriverWarning,
107+
isContainerVulkanStack,
108+
isDebugScenario4,
109+
isEGLDriverMessage,
110+
isXdgRuntimeError,
111+
isMesaZinkError,
112+
isGlxDriverError
113+
]
88114

89115
const isGarbageLineWarning = (str) => {
90116
return _.some(GARBAGE_WARNINGS, (re) => {

cli/test/lib/exec/spawn_spec.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ describe('lib/exec/spawn', function () {
9595
at Initialize (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:344)
9696
at Create (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:266)
9797
at operator() (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:521)
98-
98+
9999
[78887:1023/114920.074882:ERROR:debug_utils.cc(14)] Hit debug scenario: 4
100100
101101
[18489:0822/130231.159571:ERROR:gl_display.cc(497)] EGL Driver message (Error) eglQueryDeviceAttribEXT: Bad attribute.
@@ -112,6 +112,21 @@ describe('lib/exec/spawn', function () {
112112
expect(spawn.isGarbageLineWarning(line), `expected line to be garbage: ${line}`).to.be.true
113113
})
114114
})
115+
116+
it('returns true for XDG runtime dir warnings', () => {
117+
const str = 'error: XDG_RUNTIME_DIR is invalid or not set'
118+
expect(spawn.isGarbageLineWarning(str)).to.be.true
119+
})
120+
121+
it('returns true for MESA ZINK errors', () => {
122+
const str = 'MESA: error: ZINK: failed to choose pdev'
123+
expect(spawn.isGarbageLineWarning(str)).to.be.true
124+
})
125+
126+
it('returns true for GLX driver errors', () => {
127+
const str = 'glx: failed to create drisw screen'
128+
expect(spawn.isGarbageLineWarning(str)).to.be.true
129+
})
115130
})
116131

117132
context('.start', function () {

0 commit comments

Comments
 (0)