Skip to content

Commit

Permalink
src/sage/doctest/control.py: decrease standard --warn-long limit
Browse files Browse the repository at this point in the history
The default value of 60 cpu seconds for a normal test is too high: the
documentation suggests that a non-long test should complete in about
five seconds. So, in this commit we change the default --warn-long
value to 10 cpu seconds if the --long flag was not given.

Issue: sagemathGH-32981
  • Loading branch information
orlitzky committed Apr 16, 2024
1 parent 8a80ad7 commit 7efc04c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/sage/doctest/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,8 @@ def _init_warn_long(self):
finish in less than about 5 seconds. Longer tests typically
don't add coverage, they just make testing slow.
The default used here, for all tests, is 60 seconds.
The default used here is 10 seconds, unless `--long` was used,
in which case it is 60 seconds.
TESTS:
Expand All @@ -595,7 +596,12 @@ def _init_warn_long(self):
if self.options.warn_long >= 0: # Specified on the command line
return

self.options.warn_long = 60.0
# The developer's guide says that even a "long time" test
# should ideally complete in under five seconds, so we're
# being rather generous here.
self.options.warn_long = 10.0
if self.options.long:
self.options.warn_long = 60.0

def second_on_modern_computer(self):
"""
Expand Down

0 comments on commit 7efc04c

Please sign in to comment.