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.
This commit is contained in:
Xi Ruoyao 2024-04-05 21:58:39 +08:00
parent 658401054a
commit a093e70903
No known key found for this signature in database
GPG Key ID: ACAAD20E19E710E3

View File

@ -78,11 +78,17 @@
<screen><userinput remap="make">make</userinput></screen>
<para>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 <command>make test</command>.</para>
<para>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:</para>
<screen><userinput remap="test">make test TESTOPTS="--timeout 120"</userinput></screen>
<para>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.</para>
<para>Install the package:</para>