ci: shard test job + cheap argon2 in test mode #13

Merged
steve merged 1 commits from ci-faster-tests into main 2026-05-05 08:44:31 +01:00
Owner

Why

The CI test job runs ~3m, dominated by internal/server/http (~156s under -race). Two cheap changes here.

What

  1. Matrix-shard the test job into server-http, store, and rest (computed via go list | grep -v). Each shard gets its own runner with all CPUs to itself, so wall time becomes max(shard) instead of CPU-starved on a single runner.
  2. Cheap argon2 in test mode. HashPassword swaps to 8 KiB / 1 iter / 1 lane when testing.Testing() returns true. Production params untouched. VerifyPassword reads params from the encoded hash, so existing test call sites work unchanged.

Verification

  • go vet ./... clean
  • internal/auth tests pass
  • internal/server/http -race locally: 18.3s (vs 20s baseline) — speedup is small locally because this box has plenty of CPU; on the weak CI runner where each hash costs many multiples more under -race, the impact should be larger
## Why The CI test job runs ~3m, dominated by `internal/server/http` (~156s under `-race`). Two cheap changes here. ## What 1. **Matrix-shard the test job** into `server-http`, `store`, and `rest` (computed via `go list | grep -v`). Each shard gets its own runner with all CPUs to itself, so wall time becomes `max(shard)` instead of CPU-starved on a single runner. 2. **Cheap argon2 in test mode.** `HashPassword` swaps to 8 KiB / 1 iter / 1 lane when `testing.Testing()` returns true. Production params untouched. `VerifyPassword` reads params from the encoded hash, so existing test call sites work unchanged. ## Verification - `go vet ./...` clean - `internal/auth` tests pass - `internal/server/http -race` locally: 18.3s (vs 20s baseline) — speedup is small locally because this box has plenty of CPU; on the weak CI runner where each hash costs many multiples more under `-race`, the impact should be larger
steve added 1 commit 2026-05-05 08:41:12 +01:00
ci: shard test job + cheap argon2 in test mode
CI / Test (store) (pull_request) Successful in 38s
CI / Test (rest) (pull_request) Successful in 48s
CI / Test (server-http) (pull_request) Successful in 1m10s
CI / Lint (pull_request) Successful in 33s
CI / Build (linux/amd64) (pull_request) Successful in 24s
CI / Build (windows/amd64) (pull_request) Successful in 48s
CI / Build (linux/arm64) (pull_request) Successful in 23s
03e5ec31f1
Test job was wall-clocked by `internal/server/http` (~156s on the
self-hosted runner under -race). Two changes here cut that:

1. Matrix-shard the test job by package group: server-http, store,
   and "rest" (everything else, computed via `go list | grep -v`).
   Each shard runs on its own runner so the heavy package isn't
   CPU-starved by siblings.

2. `auth.HashPassword` drops to cheap argon2id params (8 KiB / 1
   iter / 1 lane) when `testing.Testing()` returns true. Production
   params are unchanged. VerifyPassword reads params from the
   encoded hash so cheap-params hashes verify identically — no test
   call sites need to change.
steve merged commit 4eab42a9c3 into main 2026-05-05 08:44:31 +01:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: steve/restic-manager#13