Indexer test: seed a want and a running build, since no entry is removed before both streams read non-empty

Builds: design 47 G §675 (kept while named)
This commit is contained in:
2026-11-17 09:43:05 +01:00
parent 39162a4435
commit 9a8609f770
@@ -1027,6 +1027,17 @@ func TestIndexerWritesModulesAtAMerge(t *testing.T) { // 1239/AC9; I1, I3: the m
if asks, err = js.CreateKeyValue(ctx, jetstream.KeyValueConfig{Bucket: index.Bucket(testIndexer, index.TakeInsState), History: 1}); err != nil {
t.Fatal(err)
}
// A want and a running build said before the start: the indexer removes no entry until both streams were read whole and
// not empty (design 47 G §675, 5188d36a), so the drop below removes entry.dx only with them.
fp := "src2:" + strings.Repeat("b", 64)
at := time.Now().UTC()
want, _ := json.Marshal(meshwants.WantedEvent{V: 1, Node: "n1", Module: "avahi", Fp: fp, Revision: 1, At: &at})
run, _ := json.Marshal(nodeengine.Running{V: 1, Node: "n2", Module: "avahi", Fingerprint: fp, At: at})
for subject, data := range map[string][]byte{meshwants.SubjectWanted("n1", "avahi"): want, nodeengine.SubjectRunning("n2", "avahi"): run} {
if _, err := js.Publish(ctx, subject, data); err != nil {
t.Fatal(err)
}
}
})
const merge = "89abcdef0123456789abcdef0123456789abcdef"
data, err := forgemsg.EncodeForge(forgemsg.Forge{Kind: forgemsg.ForgeMerged, Repository: "novox/mesh-delivery", Branch: "feat/x", Number: 12,