From 1560c498b67753dc22dfbbc3a8c34f835cc18633 Mon Sep 17 00:00:00 2001 From: jochen Date: Sat, 10 Oct 2026 12:49:44 +0200 Subject: [PATCH] Ask the rollback test's failed build after the registered one, whenever it runs Its id named 2026-10-10 02:40 UTC; once the clock passed that, the registered build read as newer and the test failed on main. --- cmd/mesh-controller/build_source_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/mesh-controller/build_source_test.go b/cmd/mesh-controller/build_source_test.go index f2589e1c..146ffcfe 100644 --- a/cmd/mesh-controller/build_source_test.go +++ b/cmd/mesh-controller/build_source_test.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" "errors" + "fmt" "hash/fnv" "os" "os/exec" @@ -11,6 +12,7 @@ import ( "strings" "sync" "testing" + "time" "github.com/novox/mesh-controller/internal/inventory" "github.com/novox/mesh-controller/internal/link" @@ -208,7 +210,9 @@ func TestARollbackNeverPutsBackABuildFromAnotherRepository(t *testing.T) { if _, _, err := takeIn(ctx, inv, fork); !errors.Is(err, errNotItsSource) { t.Fatalf("the fork's build was taken in: %v", err) } - failed := onTrunk("build-1791600000000000000", "novox/mesh-catalog", "git", "modules/sudo", + // Asked after the registered build, whenever the test runs: an id naming a fixed moment read as older + // than the registered build once the clock passed it (2026-10-10 02:40 UTC), and the test failed on main. + failed := onTrunk(fmt.Sprintf("build-%d", time.Now().Add(time.Hour).UnixNano()), "novox/mesh-catalog", "git", "modules/sudo", map[string]any{"module": "sudo", "version": "2"}) failed.Commit = "badbadbad0123456" if _, _, err := takeIn(ctx, inv, failed); err != nil {