From 5bb22502cdf4237f00c445595ff9acb3e0cf99b0 Mon Sep 17 00:00:00 2001 From: Jakub Kadlcik Date: Tue, 5 Mar 2024 12:54:26 +0100 Subject: [PATCH] frontend: pick the outdated chroot more deterministically See #3130 For some reason the order of `[x.name for x in self.c3.copr_chroots]` is different SQLAlchemy 1 and 2. F39: ['fedora-18-x86_64', 'fedora-rawhide-i386'] F40: ['fedora-rawhide-i386', 'fedora-18-x86_64'] --- frontend/coprs_frontend/tests/test_apiv3/test_rpmrepo.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/coprs_frontend/tests/test_apiv3/test_rpmrepo.py b/frontend/coprs_frontend/tests/test_apiv3/test_rpmrepo.py index 2eb751a44..ee8a59ff0 100644 --- a/frontend/coprs_frontend/tests/test_apiv3/test_rpmrepo.py +++ b/frontend/coprs_frontend/tests/test_apiv3/test_rpmrepo.py @@ -56,9 +56,10 @@ def test_apiv3_rpmrepo_external_deps(self): # both 'foo' and 'foo:pr:11' give the same output. self.c3.delete_after = datetime.now() + timedelta(days=180) - self.c3.copr_chroots[0].deleted = True - self.c3.copr_chroots[0].delete_after = \ - datetime.now() + timedelta(days=10) + for chroot in self.c3.copr_chroots: + if chroot.name == "fedora-18-x86_64": + chroot.deleted = True + chroot.delete_after = datetime.now() + timedelta(days=10) self.db.session.commit() for dirname in [self.c3.name, self.c3.name + ':pr:11']: