Skip to content

Trim the split-build-dir harness test, or decide it is not worth the fidelity #693

Description

@leynos

harness_compiles_under_a_split_build_dir is the last heavy test on the Windows
gate. It spawns a Cargo build of test_support, which depends on
netsuke-build, so it compiles the whole crate plus roughly 350 dependencies
into private directories to prove two things: that the collected
-L dependency= set spans a split build.build-dir, and that a control
fixture type-checks against the resulting rlib.

What it costs now

The figure has moved, and the change is the point of filing this rather than
building it.

Before #687, the test ran a median of 274.7s and its exclusive tail, the period
after every other test had reported, implied that trimming both isolated-Cargo
tests was worth 156s. #687 removed the other one from Windows, and the two had
been throttling each other on a four-vCPU runner, so this test got faster
without being touched.

Measured on the three runs after #687:

run test duration exclusive tail
34075197897 125.3s 62.3s
34079222917 170.6s 87.2s
34080385050 170.7s 85.5s

So trimming it to near zero is now worth about 85s, not 156s. Nobody should
start this expecting the larger number.

For scale, the whole Windows lane fell from a 1468s median to about 848s across
#687, #690 and #691. 85s is roughly 10 percent of what remains.

The design, if it is built

Build a minimal fixture crate under the split layout instead of test_support.
It needs at least one dependency so that dependency rlibs land in the split
build directory while the fixture's own uplifted rlib lands in the target
directory, which is the arrangement the regression exists to catch: a single
derived directory that missed the dependencies entirely.

Two things it must carry, and they are the hard part:

A fidelity argument in a doc comment, stating exactly which regression it
guards and why a fixture crate suffices where the real test_support build was
used before. The current test is a regression test for a defect that was found
once; replacing its subject with a stand-in weakens it unless the argument is
explicit about what is and is not still covered.

The Windows response-file pressure. TestSupportRlib::compile passes its
arguments through a rustc response file because Cargo 1.99 gives every crate
its own artefact directory, and this test adds long temporary roots on top, so
passing them directly exceeds the Windows CreateProcess limit and fails with
Os { code: 206 }. A fixture crate with one dependency produces far fewer
directories and would stop exercising that. Either the fixture must generate
enough search paths to keep the pressure, or the response-file contract needs
its own test and the doc comment must say so.

What was already ruled out

  • cargo check instead of cargo build. Timed cold at -j 4 on a
    32-core host: 114s against 102s, twelve percent. It also writes nothing into
    the target directory, so the uplift the regression exists to catch stops
    happening and the test passes vacuously.
  • Reusing the lane's compiler cache. It already reaches the spawned build;
    ci-windows.yml sets RUSTC_WRAPPER at job scope and the test adds to the
    child environment rather than clearing it. Warming it is worth about 3
    percent.
  • Sharing a target directory. The test needs private roots to avoid racing
    the #[once] fixture with E0460.

When to revisit

Wait until ten runs of the split lane exist, so the harness test's share of the
build-test-windows job is known under the new shape rather than estimated from
three runs. If its tail has settled below the 85s measured here, or if
Test has stopped being the lane's critical path, this is not worth the
fidelity risk.

Related

Activity

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

    enhancementNew feature or requestmediumRoadmap items to schedule within the current quarter. Clear scope, normal review cycles.performanceBugs or prior decisions disproportionately impacting memory, time, storage or CPU usagetestingTest coverage, test infrastructure, and verification tooling work.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions