docs(ci): update shared cloud routing shard rationale (#6432)

* test(dolt): verify shared cloud auth fixture without a time limit (saa-cgh.107)

Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell

* test(dolt): require cloud routing server in the opted-in full suite (saa-cgh.107)

Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell

* test(dolt): count successfully registered cloud auth cases (saa-cgh.107)

Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell

* test: describe current shared cloud-auth shard fixture (saa-cgh.119)

Agent-Signature: unknown-model/unknown-reasoning on behalf of Ewen Cuthiell
This commit is contained in:
ecuthiell 2026-09-27 02:57:07 -06:00 • committed by GitHub
commit 08fc8abb86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 17 deletions

View file

@ -2,13 +2,10 @@
#
# Format: <total_shards> <shard_number> <top_level_test_name>
#
# Unlike the embedded manifest, per-test timing is known for the tests
# pinned below (see be-extn's investigation of CI job 95616282508):
# TestCloudAuthCLIRouting alone costs ~9.5 minutes -- its 16 subtests each
# call openCloudAuthTestStore, which does CREATE DATABASE + the full
# migration chain + dolt init + dolt remote add + DROP DATABASE, and the
# test uses t.Setenv so it can never run t.Parallel. It is pinned alone on
# shard 1 so no other test shares its runtime. The remaining pins below
# TestCloudAuthCLIRouting uses one shared outer store (#5841); its
# environment-sensitive subtests run serially. #6396 checks that remote
# writes use the shared fixture without imposing a machine-speed threshold.
# It remains pinned alone on shard 1. The remaining pins below
# (TestCloudAuthCLIRoutingStructural, TestCreateGuard_* (9 tests),
# TestFederationPeerCredentialLifecycleLazyKeyInit,
# TestConcurrentWorkQueueDrain, TestHighContentionStress,

View file

@ -888,6 +888,9 @@ func clearCloudAuthEnv(t *testing.T) {
}
func TestCloudAuthCLIRouting(t *testing.T) {
if realDoltTestServerRequired() && testServerPort == 0 {
t.Fatal("Dolt server required for cloud-auth routing coverage")
}
skipIfNoServer(t)
clearCloudAuthEnv(t)
start := time.Now()
@ -922,11 +925,12 @@ func TestCloudAuthCLIRouting(t *testing.T) {
{"no cloud env", "az://account.blob.core.windows.net/container", "", "", false},
}
// Shared store: creating one Dolt database per case (16 total) is what
// made this test slow (see the regression guard below). Each case gets
// made this test slow (see the shared-store guard below). Each case gets
// its own remote name (origin_0..origin_15) against a single store,
// since shouldUseCLIForCloudAuth's routing decision is keyed purely by
// remote name — distinct names are enough to keep cases isolated.
store := openCloudAuthTestStore(t, "route")
casesRun := 0
for i, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
ctx := context.Background()
@ -934,6 +938,7 @@ func TestCloudAuthCLIRouting(t *testing.T) {
if err := store.AddRemote(ctx, remote, tt.remoteURL); err != nil {
t.Fatalf("AddRemote: %v", err)
}
casesRun++
addCloudAuthCLIRemote(t, store, remote, tt.remoteURL)
if tt.envKey != "" {
t.Setenv(tt.envKey, tt.envValue)
@ -945,16 +950,17 @@ func TestCloudAuthCLIRouting(t *testing.T) {
})
}
// Regression guard: this test previously created one Dolt database per
// case (16 total), each slower than the last as server load grew,
// pushing wall time into the hundreds of seconds for a test that only
// exercises a pure routing predicate. 90s sits below every measured
// unfixed run and comfortably above the shared-store fix's expected
// time, so it fails on the old per-case-store shape without flaking
// under normal CI load.
if elapsed := time.Since(start); elapsed > 90*time.Second {
t.Fatalf("TestCloudAuthCLIRouting took %s, want < 90s (regression: are per-case Dolt databases being created again instead of a shared store?)", elapsed)
// Every registered case must leave its distinct remote in the shared store.
// This verifies remote writes use that store; it cannot detect unused stores.
// Count only selected children so focused -run invocations still work.
remotes, err := store.ListRemotes(context.Background())
if err != nil {
t.Fatalf("ListRemotes: %v", err)
}
if len(remotes) != casesRun {
t.Errorf("shared store has %d remotes, want %d executed cases", len(remotes), casesRun)
}
t.Logf("%d cloud auth routing cases took %s", casesRun, time.Since(start))
}
func TestCloudAuthCLIRoutingStructural(t *testing.T) {