Skip to content

Measure Behat run times reliably #384

Open

Description

@schlessera

Every other performance change needs a trustworthy before/after number, and today the Behat timing data is incomplete.

WP_CLI_TEST_LOG_RUN_TIMES reports process run times, but with the default progress formatter its output is swallowed unless a scenario fails. The per-scenario part of the report is empty ("Top 20 (of 0) scenario run times"), and the scenario infix in RUN_DIR names is missing, because the current Behat version no longer exposes the feature file on the scenario node.

Steps:

  1. Make the run time report visible with the default formatter.
  2. Restore per-scenario timings.
  3. Record a baseline from GitHub CI on main for a set of reference packages (for example entity-command, extension-command, core-command, cache-command), covering the MySQL, MariaDB and SQLite jobs.

The baseline lives in this issue, so the other issues in this epic can compare against it. Per-scenario timings are also what parallel runs need to balance their shards.

Activity

  1. schlessera commented on Oct 30, 2026

    @schlessera
    MemberAuthor

    Measurement

    Measured on GitHub Actions with the full test matrix of core-command and cache-command, run on measure/* branches of wp-cli/core-command#350 and wp-cli/cache-command#137. All runs use wp-cli-tests at the same base commit (9298472) and differ only in the run time report being enabled (WP_CLI_TEST_LOG_RUN_TIMES=stdout,40,40) with the changes of #399.

    The metric is the Behat wall time of each job, from the start of the Behat step to its last summary, for the 49 Linux jobs present in all runs. "Total" is the sum over these jobs, "per job" the median of each job's change against the mean of the two baseline runs. Both baselines run the identical code, so their spread is the noise level: about ±1% for cache-command and about ±5% for core-command. All runs executed the same scenarios (about 4,518 for core-command and 1,162 for cache-command across the Linux jobs).

    core-command total core-command per job cache-command total cache-command per job
    Baseline A 13,585 s -5.4% 4,943 s -0.3%
    Baseline B 14,644 s +5.4% 5,062 s +0.3%
    #399 with the report enabled 13,633 s -5.1% 4,908 s -2.8%

    Collecting and printing the report adds no measurable cost; both differences are within the noise. The report now shows up in the job logs with the default progress formatter, including the slowest scenarios, which the other measurements in #394 can use from here on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingscope:testingRelated to testing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions