Skip to content

test: the load suite, thrust-load-tests, with the latency and scale probes as nextest tests (test-suites PR 3) - #262

Merged
aRustyDev merged 4 commits into
mainfrom
test/load-suite
Nov 17, 2026
Merged

aRustyDev merged 4 commits into
mainfrom
test/load-suite

Conversation

@aRustyDev

Copy link
Copy Markdown
Owner

PR 3 of the test-suites plan (.agents/plans/test-suites/): the load suite. crates/testing/suites/load is a new crate, thrust-load-tests. The latency and scale probes leave thrust-contract-tests, where they were binaries, and become nextest tests named load_, as the owner decided.

What

  • tests/latency.rs: load_latency_one_request_at_a_time and load_latency_eight_requests_at_once. These are the bench binary, which contract.sh ran twice, at concurrency 1 and 8. THRUST_LOAD_ITERATIONS sets the number of creates (200 by default).

  • tests/scale.rs: load_scale_list_search_and_create, the bench_scale binary. It reads THRUST_SCALE_TOTAL and THRUST_SCALE_PER_PROJECT itself, with the same defaults.

  • src/lib.rs: what the probes compute, now tested:

    • the nearest-rank percentile and a sample's summary;
    • how many API keys a run needs, and which comes next;
    • timed;
    • the items the scale test seeds.

    tests/measure.rs holds each of these to its definition over generated inputs (prop_). Those tests are hermetic and run in the default loop.

  • The load tests use the contract suite's client (Target, User, Fixture) as a dev-dependency, the one kind ADR-0009 rule 6 and check-layout.sh allow on a crate in testing/. thrust-contract-tests joins [workspace.dependencies] for it.

  • scripts/contract.sh: the bench and scale passes call load_pass <prefix>, which runs cargo nextest run --cargo-profile release -p thrust-load-tests --profile load -E 'test(/^<prefix>/)'. As before, a pass succeeds when every request succeeded, and no number gates. nextest's 4 ("no test ran") becomes 5, as for every pass.

  • .config/nextest.toml: a load profile runs one test at a time, shows output on a pass, and kills nothing. The default loop leaves out only this crate's load_ tests, not its own hermetic tests. That differs from the plan, which left out the whole package, and the plan now says so.

  • release-plz.toml: the new crate joins the version group and the changelog, with the first-release tag pattern that thrust-edge got (fix(release): give a crate added since the last release a first-release tag pattern, and check both ends #222). check-release-plz.py refused it without that.

  • Docs: AGENTS.md rule 4 gains load_. Also updated: the testing/ READMEs, performance.md, crates.md (twenty crates, fifteen workspace entries), ARCHITECTURE §2a and the plan.

Stress, spike and soak tests are not created; each joins load/ when it has a workload (ADR-0009, no stubs).

Evidence

Every check below has a control that makes it fail (AGENTS.md rule 8).

Check Result Control
cargo nextest run -p thrust-load-tests (default profile) 11 passed, the 3 load_ tests skipped
cargo nextest list --profile load exactly the 3 load_ tests
cargo mutants -p thrust-load-tests 38 mutants: 33 caught, 0 missed, 2 unviable, 3 timeouts (loops made endless, which a hung test detects) The first run missed 6. The fix was tests, not skips: report now takes the writer it writes to, so its output is checked; env_usize, and the index timed gives each call, are checked too
a load test against a target that is not there load_latency_one… with THRUST_BASE_URL=http://127.0.0.1:9: exit 100, 1 failed
contract.sh's load_pass bench and scale exit 0 on native-memory a prefix that selects nothing: exit 5, "VACUITY GUARD: no load test ran"
cargo nextest run --profile ci --workspace 4,639 passed
every command of CI's deps and ci-scripts jobs, read from ci.yml, shell scripts under dash, after merging today's main 56 of 56 check-release-plz.py refused the crate until it was declared (above)
scripts/check-layout.sh 20 crates, testing/suites/README.md names load/
cargo metadata --locked after merging main (a crate-adding PR) exit 0

The numbers. The plan asks for the same order as the binaries, measured on the same machine in the same session. All runs are on native-memory, scale at 10,000 items in projects of 1,000, with a big project of 2,000. Times are p50 in ms.

bench, c=1 create list activity
round 1: old binary, then new test 0.11 / 0.18 0.46 / 0.71 0.08 / 0.18
round 2: new test first, then old binary 0.10 / 0.11 0.43 / 0.47 0.10 / 0.06

In round 1 the new test ran right after its 26 s release build. Round 2, in the other order, shows no gap.

scale showed a repeating gap on create at c=1: 0.14 against 0.39 ms in round 1, and 0.18 against 0.44 in round 2. To tell whether nextest or the code causes it, round 3 put three clients against one target, interleaved twice: the old binary, the new test through nextest, and the new test's binary run directly.

scale, one target create c=1 list c=1 search "Fix"
old binary, rounds 1 / 2 0.25 / 0.37 1.03 / 0.99 2.42 / 2.11
new, through nextest 0.29 / 0.46 0.95 / 1.09 2.35 / 2.22
new, binary run directly 0.36 / 0.66 1.13 / 1.25 2.34 / 2.57

The client makes no difference beyond noise. What changes is the position in the sequence: each run seeds 12,000 more items into the same in-memory server, so each is slower than the one before. The earlier gaps came from separate targets on a busy machine.

Cargo.toml and .config/ changed, so CI runs everything.

🤖 Generated with Claude Code

aRustyDev and others added 4 commits November 16, 2026 22:28
…probes as nextest tests

PR 3 of the test-suites plan. crates/testing/suites/load is a new crate:

- tests/latency.rs: load_latency_one_request_at_a_time and
  load_latency_eight_requests_at_once (the `bench` binary run at
  concurrency 1 and 8); THRUST_LOAD_ITERATIONS sets the creates (200).
- tests/scale.rs: load_scale_list_search_and_create (`bench_scale`),
  reading THRUST_SCALE_TOTAL and THRUST_SCALE_PER_PROJECT itself.
- src/lib.rs: what they compute, now tested: the nearest-rank
  percentile and a sample's summary, how many keys a run needs and which
  is next, `timed`, and the items the scale test seeds. tests/measure.rs
  holds those to their definitions over generated inputs (prop_), and
  runs in the default loop. cargo-mutants on the crate: 33 caught,
  0 missed, 2 unviable, 3 timeouts (loops made endless). Its first run
  missed 6, and the fix was tests, not skips: `report` takes the writer
  it writes to, so its output is checked; `env_usize` and the index
  `timed` gives each call are checked too.
- The load tests use the contract suite's client (Target, User,
  Fixture) as a dev-dependency, the one kind ADR-0009 rule 6 and
  check-layout.sh allow on a crate in testing/. thrust-contract-tests
  joins [workspace.dependencies] for it.

The `bench` and `bench_scale` binaries leave thrust-contract-tests.
scripts/contract.sh's `bench` and `scale` passes run `load_pass`, which is
`cargo nextest run --cargo-profile release -p thrust-load-tests
--profile load -E 'test(/^<prefix>/)'`. As before, success is every
request succeeding; nextest's 4 (no test ran) becomes 5.

.config/nextest.toml: a `load` profile (one test at a time, output shown
on a pass, no kill), and the default loop leaves out only the load_ tests
of the crate, not its own hermetic tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
AGENTS.md rule 4 gains the `load_` prefix. crates/testing/README.md and
testing/suites/README.md name `load/` (stress, spike and soak join it when
each has a workload). docs/src/testing/techniques/performance.md names the
load tests behind the `bench` and `scale` passes. docs/src/contributing/
crates.md: twenty crates, fifteen in [workspace.dependencies] now that
thrust-contract-tests is a dev-dependency of thrust-load-tests.
ARCHITECTURE §2a gains `suites/load/`. The plan: PR 2 merged, PR 3's
status and what was built differently (the default loop leaves out only
the load_ tests).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… tag

check-release-plz.py (the deps job) refused the new crate: a workspace
member with no [[package]] entry, missing from thrust-core's
changelog_include, and not in v0.2.0, the last release, where release-plz
would look for it and stop ("cannot find package"). It joins the version
group and the changelog, and gets the first-release pattern
git_tag_name = "thrust-load-tests-v{{ version }}", as thrust-edge did,
until a release contains it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@aRustyDev
aRustyDev merged commit ab9c29b into main Nov 17, 2026
75 of 78 checks passed
@aRustyDev
aRustyDev deleted the test/load-suite branch November 17, 2026 04:28
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 this pull request may close these issues.

1 participant