summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2021-03-11 13:38:53 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2021-03-11 14:05:41 +0100
commit0d25ce3d466ecddea02d171981f011f7dbf95e08 (patch)
treebe5a631b2e2d2c9a34857dd1880617bfd424e7e6
parentade9d3c41da55171f258a3aeed2e3b3350da8920 (diff)
Harden test for no new acquires after transaction abortHEADmaster
If a transaction is doomed we want to gracefully shutdown our zoo of worker processes. As explained in the referenced commit we do this by stopping the main process from handing out new work and ignoring the replies it gets from the workers, so that they eventually run out of work. We tested this previously by checking if a rred worker was given work items at all, but depending on how lucky the stars of the machine working on this are the worker would have already gotten work before the transaction was aborted – so we tried this 25 times a row (f35601e5d2). No machine can be this lucky, right? Turns out the autopkgtest armhf machine is very lucky. I feel a bit sorry for feeding grep such a long "line" to work with, but it seems to work out. Porterbox amdahl (who is considerably less lucky; had to turn down to 1 try to get it to fail sometimes) is now happily running the test in an endless loop. Of course, I could have broken the test now, but its still a rather generic grep (in some ways more generic even) and the main part of the testcase – the update process finishes and fails – is untouched. References: 38f8704e419ed93f433129e20df5611df6652620 Closes: #984966
-rwxr-xr-xtest/integration/test-pdiff-usage12
1 files changed, 3 insertions, 9 deletions
diff --git a/test/integration/test-pdiff-usage b/test/integration/test-pdiff-usage
index b727aa138..38e455b00 100755
--- a/test/integration/test-pdiff-usage
+++ b/test/integration/test-pdiff-usage
@@ -254,16 +254,10 @@ SHA256-Download:
cp Packages-future aptarchive/Packages
rm -f rootdir/var/lib/apt/lists/*_Contents-*
webserverconfig 'aptwebserver::overwrite::.*Contents-.*::filename' '/hacked-i386.gz'
- # This should work in at least 4% of the cases...
- for i in $(seq 25); do
- testfailure apt update "$@"
- if ! grep -q 'rred:600' rootdir/tmp/testfailure.output; then
- break
- fi
- done
- webserverconfig 'aptwebserver::overwrite::.*Contents-.*::filename' '/Contents-i386.gz'
+ testfailure apt update "$@"
cp rootdir/tmp/testfailure.output patchdownload.output
- testfailure grep 'rred:600' patchdownload.output
+ webserverconfig 'aptwebserver::overwrite::.*Contents-.*::filename' '/Contents-i386.gz'
+ testfailure grep -q -z 'AbortTransaction.* [a-zA-Z0-9+-]\+:600%20' patchdownload.output
testnopackage newstuff futurestuff
testsuccessequal "$(cat "${PKGFILE}")
" aptcache show apt oldstuff