From a3dd07535c183433a3f1f97596e9d2b41f8a33ba Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Sat, 5 Oct 2024 14:29:52 +0200 Subject: [PATCH] fix build test error count checks with async runtime scheduling we can no longer guarantee exact error counts for builds that do not set keepGoing. the old behavior can be recovered with a number of hacks that affect scheduling, but none of those are very easy to follow now advisable. exact error counts will like not be needed for almost all uses except tests, and *those* had better check the actual messages rather than how many they got. more messages can even help to avoid unnecessary rebuilds for most users. Change-Id: I1c9aa7a401227dcaf2e19975b8cb83c5d4f85d64 --- tests/functional/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/functional/build.sh b/tests/functional/build.sh index a14f6e3c2..58fba83aa 100644 --- a/tests/functional/build.sh +++ b/tests/functional/build.sh @@ -144,8 +144,8 @@ test "$(<<<"$out" grep -E '^error:' | wc -l)" = 1 # --keep-going and FOD out="$(nix build -f fod-failing.nix -L 2>&1)" && status=0 || status=$? test "$status" = 1 -# one "hash mismatch" error, one "build of ... failed" -test "$(<<<"$out" grep -E '^error:' | wc -l)" = 2 +# at least one "hash mismatch" error, one "build of ... failed" +test "$(<<<"$out" grep -E '^error:' | wc -l)" -ge 2 <<<"$out" grepQuiet -E "hash mismatch in fixed-output derivation '.*-x.\\.drv'" <<<"$out" grepQuiet -E "likely URL: " <<<"$out" grepQuiet -E "error: build of '.*-x[1-4]\\.drv\\^out', '.*-x[1-4]\\.drv\\^out', '.*-x[1-4]\\.drv\\^out', '.*-x[1-4]\\.drv\\^out' failed"