From 6d0dc24e7d62d01680c5075fe0eb6c4d1e5758f8 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Sun, 1 Dec 2024 17:01:49 +0100 Subject: [PATCH] beaker: fix sleeping in runtest-createrepo The first sleep is useless with DNF5, the mechanism (unlike DNF4) doesn't even wait for the backend action processing. The second sleep needs to be longer. The API call is relatively expensive, and therefore cached for 120s. We need to wait for cache invalidation. --- .../copr-cli-basic-operations/runtest-createrepo.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/beaker-tests/Sanity/copr-cli-basic-operations/runtest-createrepo.sh b/beaker-tests/Sanity/copr-cli-basic-operations/runtest-createrepo.sh index dd3b68eee..107d656e5 100755 --- a/beaker-tests/Sanity/copr-cli-basic-operations/runtest-createrepo.sh +++ b/beaker-tests/Sanity/copr-cli-basic-operations/runtest-createrepo.sh @@ -16,8 +16,6 @@ rlJournalStart rlPhaseStartTest rlRun "copr-cli create ${NAME_PREFIX}Createrepo --chroot $CHROOT" - echo "sleep 60 seconds to give backend enough time to generate the repo" - sleep 60 # don't specify chroot here, rely on auto-detection rlRun "dnf -y copr enable ${URL}/${NAME_PREFIX}Createrepo" rlRun "dnf --disablerepo='*' \ @@ -25,8 +23,10 @@ rlJournalStart list available 2>&1 | grep 'Failed to synchronize'" 1 rlRun "copr-cli modify ${NAME_PREFIX}Createrepo --chroot fedora-rawhide-x86_64" - echo "sleep 60 seconds to give backend enough time to generate the repo" - sleep 60 + + echo "wait 2+ minutes to invalidate cache" + echo "https://github.com/fedora-copr/copr/blob/526473b43b5e0c1f84f7db624f349a50a8e2b7d9/frontend/coprs_frontend/coprs/views/apiv3_ns/apiv3_rpmrepo.py#L37" + sleep 125 rlRun "dnf -y copr enable ${URL}/${NAME_PREFIX}Createrepo fedora-rawhide-x86_64" rlRun "dnf --disablerepo='*' \ --enablerepo='copr:${URL}:$(repo_owner):${NAME_VAR}Createrepo' \