Skip to content

Should networkQuietThresholdMs / pauseAfterLoadMs/... be quietly overridden for non-simulated tests? #16796

@mattzeunert

Description

@mattzeunert

Lighthouse ignores wait time thresholds that are lower than the nonSimulatedSettingsOverrides if the throttling method is not set to simulate.

* Overrides the quiet windows when throttlingMethod requires observation.

/**
 * Overrides the quiet windows when throttlingMethod requires observation.
 *
 * @param {LH.Config.Settings} settings
 */
function overrideThrottlingWindows(settings) {
  if (settings.throttlingMethod === 'simulate') return;

  settings.cpuQuietThresholdMs = Math.max(
    settings.cpuQuietThresholdMs || 0,
    nonSimulatedSettingsOverrides.cpuQuietThresholdMs
  );
  settings.networkQuietThresholdMs = Math.max(
    settings.networkQuietThresholdMs || 0,
    nonSimulatedSettingsOverrides.networkQuietThresholdMs
  );
  settings.pauseAfterFcpMs = Math.max(
    settings.pauseAfterFcpMs || 0,
    nonSimulatedSettingsOverrides.pauseAfterFcpMs
  );
  settings.pauseAfterLoadMs = Math.max(
    settings.pauseAfterLoadMs || 0,
    nonSimulatedSettingsOverrides.pauseAfterLoadMs
  );
}

It seems unintuitive that these values are ignored when the user is passing them in through the config, and I've been caught by this several times.

Maybe it's not necessary?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions