Skip to content

Commit

Permalink
beaker: fix sleeping in runtest-createrepo
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
praiskup authored and FrostyX committed Dec 10, 2024
1 parent d4aee88 commit 94875c3
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ 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='*' \
--enablerepo='copr:${URL}:$(repo_owner):${NAME_VAR}Createrepo' \
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' \
Expand Down

0 comments on commit 94875c3

Please sign in to comment.