Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Second run and beyond falls back to old Chrome headless mode #1067

Open
dcsaszar opened this issue Aug 3, 2024 · 1 comment · May be fixed by #1068
Open

Second run and beyond falls back to old Chrome headless mode #1067

dcsaszar opened this issue Aug 3, 2024 · 1 comment · May be fixed by #1068

Comments

@dcsaszar
Copy link

dcsaszar commented Aug 3, 2024

Describe the bug

The Chrome --headless=new option is only effective on the first run because of repeated --headless=new --headless=new ... for the other runs, which apparently triggers the old headless mode.

To Reproduce
Steps to reproduce the behavior:

  1. Pick a URL that reports a significantly lower or higher performance with the --headless=new mode compared to --headless.
  1. Use this .lighthouserc.yml:
ci:
  assert:
    assertions:
      categories:performance: [error, minScore: 0]
    includePassedAssertions: true
  collect:
    url:
      - https://dev.d33869rf57mkjo.amplifyapp.com/
  upload:
    outputDir: .lighthouseci/results
    target: filesystem
  1. npx lhci autorun
  2. Check the three reported values
  • The first value matches the score of the browser devtools Lighthouse.
  • The second and third score are different from the first.
Checking assertions against 1 URL(s), 3 total run(s)

1 result(s) for https://dev.d33869rf57mkjo.amplifyapp.com/ :

  ✅  categories.performance passing for minScore assertion
        expected: >=0
           found: 1
      all values: 1, 0.73, 0.72

Expected behavior

  • All three scores should be similar.
  • All three scores should match the browser devtools Lighthouse result.

The expected behavior can be enforced by adding under collect::

    headful: true
    settings:
      chromeFlags: --headless=new
Checking assertions against 1 URL(s), 3 total run(s)

1 result(s) for https://dev.d33869rf57mkjo.amplifyapp.com/ :

  ✅  categories.performance passing for minScore assertion
        expected: >=0
           found: 1
      all values: 1, 1, 1

Environment (please complete the following information):

  • OS: macOS 14.5
  • Browser: Chrome
  • Version: 127.0.6533.89

Additional context

console.log({chromeFlagsAsString}) in static computeArgumentsAndCleanup(url, options) logs the problem.

dcsaszar pushed a commit to dcsaszar/lighthouse-ci that referenced this issue Aug 3, 2024
@dcsaszar dcsaszar linked a pull request Aug 3, 2024 that will close this issue
dcsaszar added a commit to dcsaszar/lighthouse-ci that referenced this issue Aug 3, 2024
dcsaszar added a commit to dcsaszar/lighthouse-ci that referenced this issue Aug 11, 2024
@organich
Copy link

Describe the bug

The Chrome --headless=new option is only effective on the first run because of repeated --headless=new --headless=new ... for the other runs, which apparently triggers the old headless mode.

To Reproduce Steps to reproduce the behavior:

  1. Pick a URL that reports a significantly lower or higher performance with the --headless=new mode compared to --headless.
  1. Use this .lighthouserc.yml:
ci:
  assert:
    assertions:
      categories:performance: [error, minScore: 0]
    includePassedAssertions: true
  collect:
    url:
      - https://dev.d33869rf57mkjo.amplifyapp.com/
  upload:
    outputDir: .lighthouseci/results
    target: filesystem
  1. npx lhci autorun
  2. Check the three reported values
  • The first value matches the score of the browser devtools Lighthouse.
  • The second and third score are different from the first.
Checking assertions against 1 URL(s), 3 total run(s)

1 result(s) for https://dev.d33869rf57mkjo.amplifyapp.com/ :

  ✅  categories.performance passing for minScore assertion
        expected: >=0
           found: 1
      all values: 1, 0.73, 0.72

Expected behavior

  • All three scores should be similar.
  • All three scores should match the browser devtools Lighthouse result.

The expected behavior can be enforced by adding under collect::

    headful: true
    settings:
      chromeFlags: --headless=new
Checking assertions against 1 URL(s), 3 total run(s)

1 result(s) for https://dev.d33869rf57mkjo.amplifyapp.com/ :

  ✅  categories.performance passing for minScore assertion
        expected: >=0
           found: 1
      all values: 1, 1, 1

Environment (please complete the following information):

  • OS: macOS 14.5
  • Browser: Chrome
  • Version: 127.0.6533.89

Additional context

console.log({chromeFlagsAsString}) in static computeArgumentsAndCleanup(url, options) logs the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants