From d86e1bab874e33f65a856d260c6ce2a83d028ec0 Mon Sep 17 00:00:00 2001 From: Jordan Baker Date: Wed, 13 May 2026 10:21:20 -0600 Subject: [PATCH 1/3] test: cleanup managed-dolt in city runtime tests Two tests build CityRuntime directly, skipping newTestCityRuntime. ensureManagedDoltPublishedForRuntime spawns real dolt sql-server at construction/tick even with stub callbacks, leaving orphaned children. Add cleanupManagedDoltTestCity(t, cityPath) for both tests. Refs hq-bgb3v --- cmd/gc/city_runtime_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/gc/city_runtime_test.go b/cmd/gc/city_runtime_test.go index f6511d734..5212fbd04 100644 --- a/cmd/gc/city_runtime_test.go +++ b/cmd/gc/city_runtime_test.go @@ -703,6 +703,9 @@ func TestCityRuntimeTickPreflightsManagedDoltBeforeSessionSnapshot(t *testing.T) cityPath := t.TempDir() cleanupManagedDoltTestCity(t, cityPath) + cityPath := t.TempDir() + cleanupManagedDoltTestCity(t, cityPath) + orderEvents := &orderedRuntimeEvents{} store := &managedDoltPreflightOrderStore{ Store: beads.NewMemStore(), From fb0a2719299464d7fbdb7b5e055900871cee5038 Mon Sep 17 00:00:00 2001 From: Jordan Baker Date: Wed, 13 May 2026 11:58:53 -0600 Subject: [PATCH 2/3] perf(tests): stub managed-dolt store openers in preflight tests The managed-dolt preflight ordering tests spawned a real dolt sql-server per test (~12s each) via newControllerState's openCityStoreAt call and newCityRuntime's sweep store open. With three tests on the hot path this cost ~38s of wall time for behavior that only verifies ordering and never needs a live store. Add two test-overridable package vars (newControllerStateOpenCityStore, newCityRuntimeOpenSweepStore) and a stubManagedDoltStoreOpeners(t) helper that swaps in fresh in-memory stores. Restored via t.Cleanup. Result: 4 target tests drop from ~50s -> ~1s aggregate. Full cmd/gc suite still green (677 tests). Closes hq-wvcvb. --- cmd/gc/city_runtime_test.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cmd/gc/city_runtime_test.go b/cmd/gc/city_runtime_test.go index 5212fbd04..d81c25552 100644 --- a/cmd/gc/city_runtime_test.go +++ b/cmd/gc/city_runtime_test.go @@ -287,7 +287,6 @@ func TestSweepUndesiredPoolSessionBeads_SkipsProtectedCreateBeforeRuntimeProbe(t t.Fatalf("IsRunning calls = %d, want 0; fresh pending create is protected by metadata", got) } } - // stubManagedDoltStoreOpeners replaces the two package-level store openers // used during newCityRuntime + newControllerState startup with in-memory // stubs. This prevents tests from spawning real managed dolt servers (~12s @@ -703,9 +702,6 @@ func TestCityRuntimeTickPreflightsManagedDoltBeforeSessionSnapshot(t *testing.T) cityPath := t.TempDir() cleanupManagedDoltTestCity(t, cityPath) - cityPath := t.TempDir() - cleanupManagedDoltTestCity(t, cityPath) - orderEvents := &orderedRuntimeEvents{} store := &managedDoltPreflightOrderStore{ Store: beads.NewMemStore(), From ff41f613d9b4cabaf64703f8abbe21f469a683ed Mon Sep 17 00:00:00 2001 From: Jordan Baker Date: Sat, 23 May 2026 09:09:19 -0600 Subject: [PATCH 3/3] style(cmd/gc): gofumpt city runtime tests --- cmd/gc/city_runtime_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/gc/city_runtime_test.go b/cmd/gc/city_runtime_test.go index d81c25552..2e0f709b2 100644 --- a/cmd/gc/city_runtime_test.go +++ b/cmd/gc/city_runtime_test.go @@ -287,6 +287,7 @@ func TestSweepUndesiredPoolSessionBeads_SkipsProtectedCreateBeforeRuntimeProbe(t t.Fatalf("IsRunning calls = %d, want 0; fresh pending create is protected by metadata", got) } } + // stubManagedDoltStoreOpeners replaces the two package-level store openers // used during newCityRuntime + newControllerState startup with in-memory // stubs. This prevents tests from spawning real managed dolt servers (~12s @@ -2782,7 +2783,8 @@ func TestCityRuntimeTick_PrefixesEachJoinedWispGCErrorLine(t *testing.T) { cfg: &config.City{}, sp: runtime.NewFake(), standaloneCityStore: store, - wg: fixedWispGC{err: fmt.Errorf("%s\n%s", + wg: fixedWispGC{err: fmt.Errorf( + "%s\n%s", "deleting expired bead \"mol-1\": delete failed", "listing closed order-tracking beads: list failed", )},