Record that splitting a slow spec file is not slow-test remediation

Problem

Splitting a slow spec file into several smaller files removes it from the slow-test report without removing any of the cost. This group has done it repeatedly, and the result is that two years of remediation issues have produced no measurable reduction in the suite's runtime.

The record, verified against master at 02c02def9c94:

  • merge request 166491 ("Improve group_service_spec.rb spec speed") did genuine optimisation work — let_it_be, dropping sidekiq_inline — and then also "move wiki visibility tests into their own spec file".
  • Commit 7e73b9deaa95 (2025-08-06) split three *_blob_and_commit* specs into separate blobs and commits files while fixing a real bug.
  • Commit e366d922 (2025-07-10) added group access search visibility specs; 0bc3b309 (2026-04-20) split the work items visibility spec into group-level and project-level files.
  • ee/spec/services/ee/search/ did not exist in 2024: its first commit is 73388fe5ba6a, 2025-06-11, and in 2024 those specs lived in ee/spec/services/search/. Counting _spec.rb files at release tags, it held 0 at v18.0.0 (2025-05-14), 4 at v18.1.0 (2025-06-18) and 43 at v18.11.0 (2026-04-15) — 39 added over that window. It holds 45 today on master at 02c02def9c94.

The consequence, from the Developer Experience triage report for 2026-09-07: 21 of those files total 89 minutes, which is 65% of the group's published top-30 test duration. No single one of them is alarming on its own. That is precisely the problem — the alarm threshold is per file, so splitting a file below the threshold makes the cost invisible to the report that is supposed to surface it.

Weekly totals for the published top 30 over the last six reports: 134.6, 125.4, 135.3, 132.1, 152.9, 137.0 minutes. Flat. Meanwhile the share of that top 30 held by the 45 spec files in ee/spec/services/ee/search/ rose from 61% to 65%.

Three of the four remediation issues filed for this group in September 2024 name files that no longer exist, because they were split and renamed rather than made faster.

Proposal

Record a convention for this group, in the place a contributor will actually read it, stating that:

  1. Splitting a spec file is a readability and ownership change, not a performance remediation. It may accompany a genuine optimisation but does not substitute for one.
  2. An MR that closes a slow-test issue must report the runtime of the whole set of files it touches, before and after — not the runtime of the one file that was named in the issue.
  3. When a file is split, the successor files must be named in the closing note of the originating issue, so the cost can be followed rather than lost.

Where to put it is an open question worth a maintainer's opinion — options include the group's own testing notes, a section in doc/development/testing_guide/unhealthy_tests.md, or the group's spec directory README. The narrower, more reversible option is the group's own documentation; that is the default proposal unless a maintainer prefers the shared guide.

Done when

  • The convention is written down somewhere a contributor to ee/spec/services/ee/search/ will encounter it.
  • The three rules above are stated explicitly, with that directory cited as the worked example of what the convention exists to prevent.

Explicitly not in scope

  • Merging the 45 files back together. The split files are individually reasonable and the current structure is not the thing to fix; the reflex is.
  • Changing the triage report or its thresholds. That is Developer Experience's tooling, and per-file thresholds are a defensible design — this is about how this group responds to them.
Edited by John Mason