Skip to content

Commit

Permalink
gh-36223: src/sage/doctest/control.py: double the default test timeout
Browse files Browse the repository at this point in the history
    
When running the test suite on an older machine, many files time out.
For example,

```
$ sage -t src/sage/manifolds/differentiable/tensorfield.py
...
File "src/sage/manifolds/differentiable/tensorfield.py", line 248,
in sage.manifolds.differentiable.tensorfield.TensorField
Warning: Consider using a block-scoped tag by inserting the line
'sage: # long time' just before this line to avoid repeating the
tag 4 times
  s = t(a.restrict(U), b) ; s  # long time
  Timed out (and interrupt failed)
...
----------------------------------------------------------------------
Total time for all tests: 360.3 seconds
  cpu time: 0.0 seconds
  cumulative wall time: 0.0 seconds
```

This has run over the default (non-long) test timeout of 300s. This
commit doubles that default, a change that should be unobjectionable for
a few reasons:

  1. This timeout is a last line of defense intended to keep the test
suite from looping forever when run unattended. For that purpose, ten
minutes is as good as five.

  2. As more tests get added to each file, those files take longer to
test on the same hardware. It should therefore be expected that we will
sometimes need to increase the timeout. (Basically, if anyone is hitting
it, it's too low.)

  3. We now use Github CI instead of patchbots for most automated
testing, and Github has its own timeout.

  4. There is a separate mechanism, --warn-long, intended to catch tests
that run for too long. The test timeout should not be thought of as a
solution to that problem.

Closes: #32973
    
URL: #36223
Reported by: Michael Orlitzky
Reviewer(s):
  • Loading branch information
Release Manager committed Dec 4, 2023
2 parents fb7ef07 + 0737944 commit d2b4578
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sage/doctest/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def __init__(self, options, args):
elif options.long:
options.timeout = int(os.getenv('SAGE_TIMEOUT_LONG', 30 * 60))
else:
options.timeout = int(os.getenv('SAGE_TIMEOUT', 5 * 60))
options.timeout = int(os.getenv('SAGE_TIMEOUT', 10 * 60))
# For non-default GC options, double the timeout
if options.gc:
options.timeout *= 2
Expand Down

0 comments on commit d2b4578

Please sign in to comment.