mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-25 08:28:45 -05:00
ignore garbage render worker errors coming from electron (#4644)
* ignore garbage render worker errors coming from electron * add tests
This commit is contained in:
@@ -13,8 +13,9 @@ const { throwFormErrorText, errors } = require('../errors')
|
||||
|
||||
const isXlibOrLibudevRe = /^(?:Xlib|libudev)/
|
||||
const isHighSierraWarningRe = /\*\*\* WARNING/
|
||||
const isRenderWorkerRe = /\.RenderWorker-/
|
||||
|
||||
const GARBAGE_WARNINGS = [isXlibOrLibudevRe, isHighSierraWarningRe]
|
||||
const GARBAGE_WARNINGS = [isXlibOrLibudevRe, isHighSierraWarningRe, isRenderWorkerRe]
|
||||
|
||||
const isGarbageLineWarning = (str) => {
|
||||
return _.some(GARBAGE_WARNINGS, (re) => {
|
||||
@@ -59,6 +60,8 @@ function getStdio (needsXvfb) {
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
isGarbageLineWarning,
|
||||
|
||||
start (args, options = {}) {
|
||||
const needsXvfb = xvfb.isNeeded()
|
||||
let executable = state.getPathToExecutable(state.getBinaryDir())
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
require('../../spec_helper')
|
||||
|
||||
const _ = require('lodash')
|
||||
const cp = require('child_process')
|
||||
const os = require('os')
|
||||
const tty = require('tty')
|
||||
@@ -46,6 +47,30 @@ describe('lib/exec/spawn', function () {
|
||||
sinon.stub(state, 'getPathToExecutable').withArgs(defaultBinaryDir).returns('/path/to/cypress')
|
||||
})
|
||||
|
||||
context('.isGarbageLineWarning', () => {
|
||||
it('returns true', () => {
|
||||
const str = `
|
||||
[46454:0702/140217.292422:ERROR:gles2_cmd_decoder.cc(4439)] [.RenderWorker-0x7f8bc5815a00.GpuRasterization]GL ERROR :GL_INVALID_FRAMEBUFFER_OPERATION : glDrawElements: framebuffer incomplete
|
||||
[46454:0702/140217.292466:ERROR:gles2_cmd_decoder.cc(17788)] [.RenderWorker-0x7f8bc5815a00.GpuRasterization]GL ERROR :GL_INVALID_OPERATION : glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
|
||||
[46454:0702/140217.292526:ERROR:gles2_cmd_decoder.cc(4439)] [.RenderWorker-0x7f8bc5815a00.GpuRasterization]GL ERROR :GL_INVALID_FRAMEBUFFER_OPERATION : glClear: framebuffer incomplete
|
||||
[46454:0702/140217.292555:ERROR:gles2_cmd_decoder.cc(4439)] [.RenderWorker-0x7f8bc5815a00.GpuRasterization]GL ERROR :GL_INVALID_FRAMEBUFFER_OPERATION : glDrawElements: framebuffer incomplete
|
||||
[46454:0702/140217.292584:ERROR:gles2_cmd_decoder.cc(4439)] [.RenderWorker-0x7f8bc5815a00.GpuRasterization]GL ERROR :GL_INVALID_FRAMEBUFFER_OPERATION : glClear: framebuffer incomplete
|
||||
[46454:0702/140217.292612:ERROR:gles2_cmd_decoder.cc(4439)] [.RenderWorker-0x7f8bc5815a00.GpuRasterization]GL ERROR :GL_INVALID_FRAMEBUFFER_OPERATION : glDrawElements: framebuffer incomplete'
|
||||
`
|
||||
|
||||
const lines = _
|
||||
.chain(str)
|
||||
.split('\n')
|
||||
.invokeMap('trim')
|
||||
.compact()
|
||||
.value()
|
||||
|
||||
_.each(lines, (line) => {
|
||||
expect(spawn.isGarbageLineWarning(line), `expected line to be garbage: ${line}`).to.be.true
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
context('.start', function () {
|
||||
it('passes args + options to spawn', function () {
|
||||
this.spawnedProcess.on.withArgs('close').yieldsAsync(0)
|
||||
|
||||
Reference in New Issue
Block a user