diff --git a/internal/link/heard_test.go b/internal/link/heard_test.go index 999957d6..05d0e6f1 100644 --- a/internal/link/heard_test.go +++ b/internal/link/heard_test.go @@ -262,39 +262,6 @@ func TestWhatFiltersAMachineIsKeptFromItsReport(t *testing.T) { } } -// Measured on the home server (novox/hq issue 267): the mesh sent d2; the machine applied it and -// reported, and a reconcile's report about d1 — made just before d2 arrived — reached the mesh after -// it. Stored last, it read as the machine never having applied d2, and the release plan waited on a -// report it had already been given. -func TestAnAccountOfAnOlderDeclarationDoesNotReplaceTheNewer(t *testing.T) { - inv := inventory.ForTest(t) - ctx := context.Background() - _, err := inv.AddNode(ctx, "home-server") - if err != nil { - t.Fatal(err) - } - heard := link.Enrolment{Inventory: inv} - if _, err := heard.Heard(ctx, link.Report{Node: "home-server", Declared: "d2", - Applied: []string{"a", "b"}, Outward: []string{"eth0"}}); err != nil { - t.Fatal(err) - } - if _, err := heard.Heard(ctx, link.Report{Node: "home-server", Declared: "d1", - Applied: []string{"a"}, Outward: []string{"eth1"}}); err != nil { - t.Fatal(err) - } - doing, said, err := inv.DoingOf(ctx, "home-server") - if err != nil || !said { - t.Fatalf("no account kept: %v", err) - } - if doing.Declared != "d2" || doing.Applied != 2 { - t.Fatalf("the older report replaced the account of what was sent: %+v", doing) - } - // What it says about the machine is kept whenever it arrives, as before. - if links, err := inv.OutwardLinksOf(ctx, "home-server"); err != nil || len(links) != 1 || links[0] != "eth1" { - t.Fatalf("what the older report said about the machine was not kept: %v %v", links, err) - } -} - // The account of the declaration that is outstanding replaces whatever was kept, and so does one // from a machine nothing was ever recorded as sent to. func TestAnAccountOfTheSentDeclarationReplacesTheKeptOne(t *testing.T) {