From a093e70903b0927261c63c2af364179e5d978362 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 5 Apr 2024 21:58:39 +0800 Subject: [PATCH] python: Run test suite with a time limit The test hang issue is not related to partial environment. It's just a known issue (for eg https://github.com/python/cpython/issues/91155) and happens when we are unlucky. So just run the test suite with a timeout. 1 SBU should be enough: it's approximately 4 times of the time used by the slowest test case, on both an old Athlon 64 3000+ and a Core i5-11300H. I've not seen any test failure on a complete system (the expat-related failure seems fixed by expat-2.6.2 or 2.6.1). TODO: really test this with LFS chroot and document failures if any. --- chapter08/python.xml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/chapter08/python.xml b/chapter08/python.xml index 7ac618c09..8d3c1f905 100644 --- a/chapter08/python.xml +++ b/chapter08/python.xml @@ -78,11 +78,17 @@ make - Running the tests at this point is not recommended. The - tests are known to hang indefinitely in the partial LFS environment. - If desired, the tests can be rerun at the end of this chapter, or - when Python 3 is reinstalled in BLFS. To run the tests anyway, - issue make test. + Some tests are known to hang indefinitely. So to test the + results, run the test suite but set a 2-minute time limit for each + test case: + +make test TESTOPTS="--timeout 120" + + For a relatively slow system you may need to increase the time + limit and 1 SBU (measured when building Binutils pass 1 with one CPU + core) should be enough. Some tests are flaky, so the test suite will + automatically re-run failed tests. If a test failed but then passed + when re-run, it should be considered as passed. Install the package: