Skip to content

Conversation

@orlitzky
Copy link
Contributor

Two calls to FileDocTestSource.create_doctests() in this file can take a while (about 5s) on the first run. This now triggers a "slow doctest" warning if you are unlucky, and is unusually annoying because doctesting this file is expected to produce no output in a doctest in src/sage/doctest/forker.py.

We add # long time to correct that random doctest failure. In any case, the two tests do take a long time.

Fixes

Two calls to FileDocTestSource.create_doctests() in this file can take
a while (about 5s) on the first run. This now triggers a "slow
doctest" warning if you are unlucky, and is unusually annoying because
doctesting this file is expected to produce no output in a doctest in
src/sage/doctest/forker.py.

We add "# long time" to correct that random doctest failure. In any
case, the two tests do take a long time.
@github-actions
Copy link

Documentation preview for this PR (built with commit 03c2986; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@orlitzky orlitzky added the p: CI Fix merged before running CI tests label Aug 23, 2025
@user202729
Copy link
Contributor

if the issue is caused by the first run, it might happen that adding # long time will just push the problem to a later test. Unless this is all the tests there are that tests this code path in this file.

@orlitzky
Copy link
Contributor Author

if the issue is caused by the first run, it might happen that adding # long time will just push the problem to a later test. Unless this is all the tests there are that tests this code path in this file.

That's exactly what happened. There were only two tests for create_doctests() that use sage.doctest.sources.__file__, though, and I got them both.

@user202729
Copy link
Contributor

user202729 commented Aug 26, 2025

Disadvantage is meson regression will go unnoticed, probably.

cf. #40158

vbraun pushed a commit to vbraun/sage that referenced this pull request Sep 1, 2025
sagemathgh-40672: src/sage/doctest/sources.py: add "long time" for two tests
    
Two calls to `FileDocTestSource.create_doctests()` in this file can take
a while (about 5s) on the first run. This now triggers a "slow doctest"
warning if you are unlucky, and is unusually annoying because doctesting
this file is expected to produce no output in a doctest in
`src/sage/doctest/forker.py`.

We add `# long time` to correct that random doctest failure. In any
case, the two tests do take a long time.

### Fixes
* sagemath#40661
    
URL: sagemath#40672
Reported by: Michael Orlitzky
Reviewer(s):
@vbraun vbraun merged commit 5e10ce7 into sagemath:develop Sep 7, 2025
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p: CI Fix merged before running CI tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants