sage: tweak cpu threshold to decrease test flakiness

This commit is contained in:
Mauricio Collares 2026-07-01 15:28:42 -03:00
commit 1acf7f6f3e
2 changed files with 35 additions and 0 deletions

View file

@ -0,0 +1,32 @@
diff --git a/src/sage/doctest/test.py b/src/sage/doctest/test.py
index 812f8167c12..a4822642f0c 100644
--- a/src/sage/doctest/test.py
+++ b/src/sage/doctest/test.py
@@ -49,11 +49,11 @@ Check that :issue:`2235` has been fixed::
Check slow doctest warnings are correctly raised::
- sage: subprocess.call(["python3", "-m", "sage.doctest", "--warn-long", # long time
+ sage: subprocess.call(["python3", "-m", "sage.doctest", "--warn-long", "0.2", # long time
....: "--random-seed=0", "--optional=sage", "sleep2.rst"], **kwds)
Running doctests...
Doctesting 1 file.
- ... --warn-long --random-seed=0 sleep2.rst
+ ... --warn-long 0.2 --random-seed=0 sleep2.rst
**********************************************************************
File "sleep2.rst", line 4, in sage.doctest.tests.sleep2
Warning: slow doctest:
@@ -66,11 +66,11 @@ Check slow doctest warnings are correctly raised::
----------------------------------------------------------------------
...
0
- sage: subprocess.call(["python3", "-m", "sage.doctest", "--format=github", "--warn-long", # long time
+ sage: subprocess.call(["python3", "-m", "sage.doctest", "--format=github", "--warn-long", "0.2", # long time
....: "--random-seed=0", "--optional=sage", "sleep2.rst"], **kwds)
Running doctests...
Doctesting 1 file.
- ... --warn-long --random-seed=0 sleep2.rst
+ ... --warn-long 0.2 --random-seed=0 sleep2.rst
**********************************************************************
::warning title=Warning: slow doctest:,file=sleep2.rst,line=4::slow doctest:: Test ran for ...s cpu, ...s wall%0ACheck ran for ...s cpu, ...s wall%0A
while walltime(t) < 2: pass

View file

@ -78,6 +78,9 @@ stdenv.mkDerivation rec {
# a more conservative version of https://github.com/sagemath/sage/pull/37951
./patches/gap-element-crash.patch
# https://github.com/sagemath/sage/issues/42473
./patches/lower-sleep2-test-threshold.patch
# https://github.com/sagemath/sage/pull/42009, landed in 10.10.beta0
(fetchpatch2 {
name = "gap-root-paths.patch";