Merge pull request 'mesh-knowledge: the bus test passes on any day (issue 540)' (#235) from fix/540-knowledge-test-clock into main

This commit was merged in pull request #235.
This commit is contained in:
2026-10-12 10:31:18 +00:00
@@ -28,10 +28,15 @@ import (
const bundleVar = "MESH_KNOWLEDGE_TEST_BUNDLE"
// bundleDay is the bundle's clock: the day the fixture's proposals are dated (valid's Date), so a reservation and the
// proposal after it are of one day whatever day the test runs on (issue 540).
var bundleDay = time.Date(2026, 10, 11, 9, 0, 0, 0, time.UTC)
func TestMain(m *testing.M) {
if os.Getenv(bundleVar) == "1" {
// The bundle the bus test starts: the knowledge base as the runtime launches it, its store in memory.
k := newKB(newMemStore())
k.Now = func() time.Time { return bundleDay }
serve(k, os.Getenv("MESH_KNOWLEDGE_STATUS"))
os.Exit(0)
}