Require both members in RPM member-order test (#175)

Both members in the parallel_fetch member-order test publish the same NEVRA. The merge dedupes them, so b.rpm never reaches the merged primary, and the assertion skips the order check whenever b.rpm is missing.

- give each member a distinct package name so both packages appear in the merged primary
- require a.rpm and b.rpm both present, with a before b

Reviewed-on: #175
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
This commit was merged in pull request #175.
This commit is contained in:
2026-10-25 20:23:39 +11:00
committed by BenVincent
parent 5f33abba93
commit a4a4fe57c9
+2 -2
View File
@@ -452,7 +452,7 @@ func TestMergeRPMPassesParallelFetchAndKeepsMemberOrder(t *testing.T) {
if name == "a" {
time.Sleep(20 * time.Millisecond)
}
return &RPMMember{RemoteName: name, Data: map[string][]byte{"primary": primaryXML(primaryPkgXML("foo", "1", name+"sum", name+".rpm"))}}, nil
return &RPMMember{RemoteName: name, Data: map[string][]byte{"primary": primaryXML(primaryPkgXML("foo-"+name, "1", name+"sum", name+".rpm"))}}, nil
}
virt := rpmVirt("a", "b")
virt.ParallelFetch = true
@@ -465,7 +465,7 @@ func TestMergeRPMPassesParallelFetchAndKeepsMemberOrder(t *testing.T) {
}
primary := regexp.MustCompile(`repodata/[0-9a-f]+-primary\.xml\.gz`).FindString(string(repo.Repomd))
body := string(gunzip(t, repo.Files[primary]))
if a, b := strings.Index(body, "a.rpm"), strings.Index(body, "b.rpm"); a < 0 || b >= 0 && b < a {
if a, b := strings.Index(body, "a.rpm"), strings.Index(body, "b.rpm"); a < 0 || b < a {
t.Fatalf("member priority order lost:\n%s", body)
}
}