From 7628b0e5b9f83559d9b88e5bb8dfafeb2813e330 Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 12 Oct 2026 12:23:38 +0200 Subject: [PATCH] mesh-knowledge: give the bus test's bundle a fixed clock, so it passes on any day (issue 540) The bundle dated a reservation from the real day while the proposal kept the fixture's 2026-10-11, so the date rule refused it on every later day. --- modules/mesh-knowledge/cmd/mesh-knowledge/kit_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/mesh-knowledge/cmd/mesh-knowledge/kit_test.go b/modules/mesh-knowledge/cmd/mesh-knowledge/kit_test.go index 1d0ad616..ddcf60f1 100644 --- a/modules/mesh-knowledge/cmd/mesh-knowledge/kit_test.go +++ b/modules/mesh-knowledge/cmd/mesh-knowledge/kit_test.go @@ -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) }