Change the rpmmd cache directory structure to include the distro name

This causes dnf-json to use separate caches, allowing them to run in
parallel, with one lock per distribution. Multiple depsolves with the
same distribution in the blueprint will continue to be serial.
This commit is contained in:
Brian C. Lane 2023-03-01 15:06:33 -08:00 committed by Achilleas Koutsou
parent 2ab0430d5d
commit 3481e1d3ba
10 changed files with 47 additions and 24 deletions

View file

@ -38,7 +38,7 @@ func TestDepsolver(t *testing.T) {
assert := assert.New(t)
tmpdir := t.TempDir()
solver := NewSolver("platform:el9", "9", "x86_64", tmpdir)
solver := NewSolver("platform:el9", "9", "x86_64", "rhel9.0", tmpdir)
solver.SetDNFJSONPath("../../dnf-json")
{ // single depsolve
@ -346,7 +346,7 @@ func TestMakeDepsolveRequest(t *testing.T) {
err: true,
},
}
solver := NewSolver("", "", "", "")
solver := NewSolver("", "", "", "", "")
for idx, tt := range tests {
t.Run(fmt.Sprintf("%d", idx), func(t *testing.T) {
req, _, err := solver.makeDepsolveRequest(tt.packageSets)
@ -532,7 +532,7 @@ func TestErrorRepoInfo(t *testing.T) {
},
}
solver := NewSolver("f36", "36", "x86_64", "/tmp/cache")
solver := NewSolver("f36", "36", "x86_64", "fedora-36", "/tmp/cache")
solver.SetDNFJSONPath("../../dnf-json")
for idx, tc := range testCases {
t.Run(fmt.Sprintf("%d", idx), func(t *testing.T) {
@ -565,7 +565,7 @@ func TestRepoConfigHash(t *testing.T) {
}
func TestRequestHash(t *testing.T) {
solver := NewSolver("f36", "36", "x86_64", "/tmp/cache")
solver := NewSolver("f36", "36", "x86_64", "fedora-36", "/tmp/cache")
repos := []rpmmd.RepoConfig{
rpmmd.RepoConfig{
Name: "A test repository",