Merge pull request 'The placement test's resolved values carry their source, as mesh-config writes them (issue 1126)' (#159) from fix/1126-seed-same-2 into main

This commit was merged in pull request #159.
This commit is contained in:
2026-10-28 10:08:46 +00:00
+5 -5
View File
@@ -442,7 +442,7 @@ func h8back(t *testing.T, b *itBed, placement, resolved, candidates nats.KeyValu
pkey, _ := delivery.PlacementKey(itNode) pkey, _ := delivery.PlacementKey(itNode)
// A pass in flight at the switch (issue 1126, 2026-10-28: the last pass of the own run, failing on its run's end, // A pass in flight at the switch (issue 1126, 2026-10-28: the last pass of the own run, failing on its run's end,
// marked the next agent's modules failed): a config value changed starts one, and the key goes at once. // marked the next agent's modules failed): a config value changed starts one, and the key goes at once.
if _, err := resolved.Put(itNode+".web.greeting", []byte(`{"value":"salut"}`)); err != nil { if _, err := resolved.Put(itNode+".web.greeting", []byte(`{"value":"salut","source":"module"}`)); err != nil {
t.Fatal(err) t.Fatal(err)
} }
if err := placement.Delete(pkey); err != nil { if err := placement.Delete(pkey); err != nil {
@@ -553,9 +553,9 @@ func h8(t *testing.T, b *itBed, checkBuild bool) (func(), h8state) {
key string key string
value []byte value []byte
}{{manifests, mkey, mraw}, {modules, "web", modv}, {b.haves, hkey, rec}, }{{manifests, mkey, mraw}, {modules, "web", modv}, {b.haves, hkey, rec},
{resolved, itNode + ".web.greeting", []byte(`{"value":"bonjour"}`)}, {resolved, itNode + ".web.greeting", []byte(`{"value":"bonjour","source":"module"}`)},
{manifests, mlkey, mlraw}, {modules, "mailer", mlmod}, {b.haves, hkey2, rec2}, {placement, pkey2, place2}, {manifests, mlkey, mlraw}, {modules, "mailer", mlmod}, {b.haves, hkey2, rec2}, {placement, pkey2, place2},
{resolved, "it2.mailer.domain", []byte(`{"value":"example.org"}`)}, {builds, buildKey, firstBuild}} { {resolved, "it2.mailer.domain", []byte(`{"value":"example.org","source":"module"}`)}, {builds, buildKey, firstBuild}} {
if _, err := w.kv.Put(w.key, w.value); err != nil { if _, err := w.kv.Put(w.key, w.value); err != nil {
t.Fatal(err) t.Fatal(err)
} }
@@ -590,7 +590,7 @@ func h8(t *testing.T, b *itBed, checkBuild bool) (func(), h8state) {
if _, err := builds.Put(buildKey, done); err != nil { if _, err := builds.Put(buildKey, done); err != nil {
t.Fatal(err) t.Fatal(err)
} }
if _, err := resolved.Put(itNode+".web.greeting", []byte(`{"value":"bonjour"}`)); err != nil { if _, err := resolved.Put(itNode+".web.greeting", []byte(`{"value":"bonjour","source":"module"}`)); err != nil {
t.Fatal(err) t.Fatal(err)
} }
} }
@@ -608,7 +608,7 @@ func h8rest(t *testing.T, b *itBed, resolved, candidates nats.KeyValue, hkey str
t.Errorf("the controller's compositions hold %v; the node composed its own", keys) t.Errorf("the controller's compositions hold %v; the node composed its own", keys)
} }
first := b.have("web").Composed first := b.have("web").Composed
if _, err := resolved.Put(itNode+".web.greeting", []byte(`{"value":"salut"}`)); err != nil { if _, err := resolved.Put(itNode+".web.greeting", []byte(`{"value":"salut","source":"module"}`)); err != nil {
t.Fatal(err) t.Fatal(err)
} }
within(t, 3*time.Second, "a changed config value was not composed and applied again", func() bool { return b.file("web") == "greeting=salut\n" }) within(t, 3*time.Second, "a changed config value was not composed and applied again", func() bool { return b.file("web") == "greeting=salut\n" })