Skip to content

Commit

Permalink
tasks: Speed up test_pr()
Browse files Browse the repository at this point in the history
The `[ -t 0 ]` check in `cockpit-tasks` doesn't do anything any more, as
the integration tests now run that script with `podman exec`, without an
attached tty. This is also a bit awkward for the upcoming pytest
rewrite, so replace it with an environment variable.
  • Loading branch information
martinpitt committed Mar 18, 2024
1 parent 1a44b6e commit 18c0823
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions tasks/container/cockpit-tasks
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ function update_bots() {
fi
}

# wait between 1 and 10 minutes, but not in an interactive terminal (annoying for debugging)
# wait between 1 and 10 minutes, with an override to speed up tests
function slumber() {
if [ -t 0 ]; then
sleep 10
if [ -n "${SLUMBER:-}" ]; then
sleep "$SLUMBER"
else
sleep $(shuf -i ${1:-60-600} -n 1)
fi
Expand Down
2 changes: 1 addition & 1 deletion tasks/run-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ test_pr() {

# run the main loop in the background; we could do this with a single run-queue invocation,
# but we want to test the cockpit-tasks script
podman exec -i cockpituous-tasks cockpit-tasks &
podman exec -i --env=SLUMBER=5 cockpituous-tasks cockpit-tasks &
TASKS_PID=$!

podman exec -i cockpituous-tasks sh -euxc "
Expand Down

0 comments on commit 18c0823

Please sign in to comment.