lighthouse-ci icon indicating copy to clipboard operation
lighthouse-ci copied to clipboard

CI fails with "NO_FCP" error on the 3rd run.

Open MarkLyck opened this issue 2 years ago • 2 comments

Describe the bug When running lighthouse in our CI/CD it consistently fails on the 3rd "run" with the error:

"runtimeError": {
    "code": "NO_FCP",
    "message": "The page did not paint any content. Please ensure you keep the browser window in the foreground during the load and try again. (NO_FCP)"
  },

To Reproduce Steps to reproduce the behavior:

  1. Follow setup instructions for @lhci/[email protected]
  2. Run GitHub action in CI/CD

Expected behavior I would expect all 3 runs of the lighthouse to be the same. If there is a problem it should occur in all 3 runs or all 3 runs should pass with the results.

Logs/Screenshots

Healthcheck passed!

Automatically determined ./build as `staticDistDir`.
Set it explicitly in lighthouserc.json if incorrect.

Started a web server on port 43883...
Running Lighthouse 3 time(s) on http://localhost:43883/index.html
Run #1...done.
Run #2...done.
Error: Lighthouse failed with exit code 1
Run #3...failed!
    at ChildProcess.<anonymous> (/opt/hostedtoolcache/node/16.13.1/x64/lib/node_modules/@lhci/cli/src/collect/node-runner.js:120:21)
    at ChildProcess.emit (node:events:390:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
{
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/96.0.4664.110 Safari/537.36",
  "environment": {
    "networkUserAgent": "",
    "hostUserAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/96.0.4664.110 Safari/537.36",
    "benchmarkIndex": 1638,
    "credits": {}
  },
  "lighthouseVersion": "8.0.0",
  "fetchTime": "2021-12-29T21:37:36.156Z",
  "requestedUrl": "http://localhost:43883/index.html",
  "finalUrl": "http://localhost:43883/index.html",
  "runWarnings": [
    "The page did not paint any content. Please ensure you keep the browser window in the foreground during the load and try again. (NO_FCP)"
  ],
  "runtimeError": {
    "code": "NO_FCP",
    "message": "The page did not paint any content. Please ensure you keep the browser window in the foreground during the load and try again. (NO_FCP)"
  },

Environment (please complete the following information):

  • OS: Github actions
  • Browser: chrome
  • Version 0.8.x

Additional context Running lighthouse locally works just fine. The app renders just fine and has no issues. There are no build errors to report. Only lighthouse fails.

MarkLyck avatar Dec 29 '21 22:12 MarkLyck

I manually changed it to only do 2 runs and the CI is passing now 🤷‍♂️ . This is obviously not a solution but just adding information.

MarkLyck avatar Dec 31 '21 03:12 MarkLyck

Seems like I spoke too soon. Sometimes it still fails on Run #2 as well with the same unhelpful error.

My best guess is that the performance of lighthouse is getting worse with each consecutive run it performs... That would explain why it always fails on run #3, and sometimes fail on run #2, but so far I have never seen it fail on run #1

MarkLyck avatar Dec 31 '21 15:12 MarkLyck