Let the CI GPU flag reach the Cypress browser - #112
Open
coutoPL wants to merge 25 commits into
Open
Conversation
The workflow sets ELECTRON_EXTRA_LAUNCH_ARGS to --disable-gpu. The yarn "run" script set the same variable again on the command line. The command line won, so Electron got --ignore-gpu-blocklist and never got --disable-gpu. The CI machine has no GPU. Electron fell back to the SwiftShader software driver. On Kibana 9.5.1 the Discover page then stopped the browser, and the renderer crashed. That crash killed Reporting.cy.ts and skipped its remaining tests. The "run" script now keeps the variable if the caller sets it, and uses --ignore-gpu-blocklist only as the default. run-tests.sh no longer forces --disable-gpu, because that also cancelled the macOS fix for local runs.
This comment was marked as outdated.
This comment was marked as outdated.
The repo variable ROR_S3_PATH_E2E_REPORTS ends with a slash, and the upload action appends /build_<run id> to it. Every key therefore carried // in the middle, and the DGP gateway answers 400 to such a PUT. Uploads went from uploaded=65 on 17 Aug to uploaded=0 failed=32 on 20 Aug, so a red e2e job now leaves no video and no screenshot behind. Squeeze the repeated slashes in the prefix. The key is then correct whatever the variable holds, and all three call sites get the fix.
The renderer crash in Reporting.cy.ts survived the GPU flag change: run 32350527210 crashed seven times in 60 suite runs, against three in 15 for the same-day nightly on master. The flag is not the cause, so Electron itself is the next suspect. CYPRESS_BROWSER now selects the browser. Electron stays the default, so a local run does not change, and the three CI e2e steps ask for Chrome. run-tests.sh prints the browser it uses, and a one-second step prints the Chrome version, so each log says plainly which browser ran and fails early if the image lacks it. If Chrome runs clean, the CSV download check that Discover.exportToCsv skips today can come back as well.
Chrome refuses navigator.clipboard.readText() until the browser grants the permission. Every test that reads a copied link therefore failed with NotAllowedError as soon as the suite left Electron: run 32423280991 shows seven or eight such failures in each job, in Tenancy.cy.ts and in the two read-only sanity checks. Grant the permission through CDP before the read, and only for a real Chromium browser, since Electron asks for nothing. Focus the document as well, because headless Chrome reads the clipboard only for a focused page.
The permission grant removed the NotAllowedError, but headless Chrome still
gives a test an empty clipboard. Run 32456671873 shows the result in every job:
expected '' to include 'https://localhost:5601/s/default/app/r/s', in
Tenancy.cy.ts and in the two read-only sanity checks.
Remember what the page copies instead. Kibana copies through
navigator.clipboard.writeText or through document.execCommand('copy') over a
selected node, so both paths now record the text, and the test reads it back.
The real clipboard stays as the fallback, which is the path Electron keeps
taking.
This was referenced Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What breaks today
Reporting.cy.tsfails on Kibana 9.5.1. It does not fail an assertion. The browser dies.Cypress calls this a renderer crash. The crash stops the whole spec file. The three other tests do not run, so the report shows
1 failing, 3 skipped.I read the logs of eight crashes in five jobs from the last week. All eight are the same:
Reporting.cy.ts. No other spec crashed.The servers were healthy at that moment. Elasticsearch used 2.5 GB and 2% of the CPU. Kibana used 950 MB. The machine had 8 GB of free memory. No container was out of memory. Only the browser was dead.
Reporting.cy.tsfails first because it opens Discover more often than the other specs. It logs in four times, and each test goes to Discover again.Why it happens
We start the browser with the wrong flag.
The workflow sets this variable for the test step:
But
package.jsonset the same variable again, on the command line. The command line wins. So Electron got--ignore-gpu-blocklist, and never got--disable-gpu.The effect is the opposite of the intent. The CI machine has no graphics card. Electron tried to use one, and fell back to the SwiftShader software driver. That driver is slow, and it is not stable. The job logs show it:
Discover in Kibana 9.5.1 is a heavy page. The software driver must draw it. The browser stops, and then it dies.
Commit 4888f08 added
--ignore-gpu-blocklistin June. It fixed a WebGL problem on macOS for local runs. It also overrode CI from that day, and nobody saw it.What this PR changes
package.jsonnow keepsELECTRON_EXTRA_LAUNCH_ARGSif the caller sets it. It uses--ignore-gpu-blocklistonly as the default. CI therefore gets--disable-gpu, and a local macOS run keeps the June fix.run-tests.shno longer exports--disable-gpu. That line had no effect in CI, and it cancelled the June fix on your laptop.I tested the default in
shand inbash. If the variable is unset or empty, the browser gets--ignore-gpu-blocklist. If the caller sets it, the browser gets that value.One honest limit
The flag is not proof. The crashes started on 13 August, when 9.5.1 entered the matrix. The flag is two months older. Kibana 9.5.1 is the trigger, but this flag is the part we own, and it is wrong today.
Please do not read one green run as a pass. The crash appears in about one attempt in three. The workflow also retries the whole suite once, so a nightly job can show green on the second attempt.
If the crash comes back, the next step is to run CI on Chrome instead of Electron. That removes this class of failure. It also lets us switch on the CSV download check that is off today in
Discover.exportToCsv.