mesh-knowledge tests: set the local zone once before any goroutine, not under a running bus server (race found by the repository check on #237)

inZone wrote time.Local while the bus test's nats server read it from a
goroutine that outlives its test; the race detector the repository check
now runs failed TestAReviewOwedOutlivesARestartAndItsLastTryIsSaid.
This commit is contained in:
jochen
2026-10-12 13:25:09 +02:00
parent 2051d8b80b
commit ca3c3e6dfd
2 changed files with 11 additions and 5 deletions
@@ -40,6 +40,9 @@ func TestMain(m *testing.M) {
serve(k, os.Getenv("MESH_KNOWLEDGE_STATUS"))
os.Exit(0)
}
// Every test runs in a zone that is not UTC, so a time said locally is proven to be, wherever the tests run. It
// is set once, before any goroutine starts: a test that set it while a bus test's server read it raced.
time.Local = testZone
code := m.Run()
stopPostgres()
os.Exit(code)