From a82cf4902d39e52b85bcf110bf7f1ca465239769 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Wed, 20 Mar 2024 12:55:02 +0000 Subject: [PATCH 1/2] test: delete private images on clean-again Private images are not reused, they are unique to tests, so delete them as they take a lot of disk space, and we are starting to run in /var/tmp space issues on the Ubuntu CI --- test/test-functions | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/test-functions b/test/test-functions index b99580bfd84a8..0c0ffa1545edc 100644 --- a/test/test-functions +++ b/test/test-functions @@ -3338,6 +3338,13 @@ test_cleanup_again() { [ -n "$TESTDIR" ] || return rm -rf "$TESTDIR/unprivileged-nspawn-root" [[ -n "$initdir" ]] && _umount_dir "$initdir" + # Test specific images are not reused, so delete them or we run out of disk space + if [[ -n "$IMAGE_PUBLIC" ]] && [ "$(basename "$IMAGE_PUBLIC")" != "default.img" ]; then + rm -vf "$IMAGE_PUBLIC" + fi + if [[ -n "$IMAGE_PRIVATE" ]] && [ "$(basename "$IMAGE_PRIVATE")" != "default.img" ]; then + rm -vf "$IMAGE_PRIVATE" + fi } test_create_image() { From 437eddcb412d54d5045a995410b9739d64cee5b3 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Thu, 21 Mar 2024 11:11:01 +0000 Subject: [PATCH 2/2] test: run clean-again between tests, not at the end So that we free up space for the next run, as we are seeing disk space issues on Ubuntu CI due to the many images built and left around --- test/run-integration-tests.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/test/run-integration-tests.sh b/test/run-integration-tests.sh index 833f6093aae83..e1c0c0ae9c005 100755 --- a/test/run-integration-tests.sh +++ b/test/run-integration-tests.sh @@ -118,14 +118,12 @@ if [[ ${#ARGS[@]} -ne 0 ]]; then RESULTS["$test"]="$result" TIMES["$test"]="$SECONDS" - [[ "$result" -ne 0 ]] && FAILURES=$((FAILURES + 1)) - done -fi - -# Run clean-again, if requested, and if no tests failed -if [[ $FAILURES -eq 0 && $CLEAN_AGAIN -eq 1 ]]; then - for test in "${!RESULTS[@]}"; do - test_run "$test" make -C "$test" clean-again + # Run clean-again here to free up space, if requested, and if the test succeeded + if [[ "$result" -ne 0 ]]; then + FAILURES=$((FAILURES + 1)) + elif [[ $CLEAN_AGAIN -eq 1 ]]; then + test_run "$test" make -C "$test" clean-again + fi done fi