Skip to content

Conversation

@jayaddison
Copy link
Contributor

@jayaddison jayaddison commented Nov 27, 2025

Purpose

Thanks to the output of pytest's slowest-duration-tests output, as produced when the Sphinx test suite ran on Windows in GitHub Actions CI, I noticed that some linkcheck tests on Windows seem to be unexpectedly long-duration (reported as more than 4 seconds each).

I'm curious whether this is due to the use of the freshenv=True project setup test parameter -- so I'm experimenting with unsetting the fresenv parameter for those tests here.

The linkcheck tests in particular do seem to use it a lot in our testsuite:

$ grep -rwc freshenv tests|grep -vw 0
tests/test_transforms/test_transforms_post_transforms.py:3
tests/test_ext_napoleon/test_ext_napoleon_docstring.py:1
tests/test_writers/test_docutilsconf.py:2
tests/test_markup/test_smartquotes.py:12
tests/test_extensions/test_ext_viewcode.py:4
tests/test_extensions/test_ext_todo.py:3
tests/test_extensions/test_ext_duration.py:8
tests/test_intl/test_intl.py:3
tests/test_domains/test_domain_py_pyobject.py:1
tests/test_domains/test_domain_js.py:1
tests/test_domains/test_domain_py.py:6
tests/test_domains/test_domain_py_canonical.py:1
tests/test_environment/test_environment_indexentries.py:8
tests/test_environment/test_environment.py:1
tests/test_command_line.py:3
tests/test_ext_autodoc/test_ext_autodoc_typehints.py:1
tests/test_search.py:3
tests/test_builders/test_build_warnings.py:4
tests/test_builders/test_build_latex.py:1
tests/test_builders/test_build_linkcheck.py:33
tests/test_builders/test_incremental_reading.py:2

References

@jayaddison
Copy link
Contributor Author

Removing the freshenv=True argument does not appear to have made a difference: https://github.com/sphinx-doc/sphinx/actions/runs/19750249013/job/56591850933?pr=14112#step:9:2435

@jayaddison jayaddison closed this Nov 28, 2025
@jayaddison jayaddison deleted the tests/experiment-remove-linkcheck-freshenv branch November 28, 2025 00:09
@AA-Turner
Copy link
Member

@jayaddison could we just decouple the tests from Sphinx? As I see it there are two parts: that the links are properly detected from source files (requires Sphinx) and that links are properly marked as working/otherwise.

See the recent changes to the autodoc tests where most tests no longer require the app fixture, I wonder if there's something similar we could do here?

A

@jayaddison
Copy link
Contributor Author

@AA-Turner that sounds worthwhile, although I haven't completely gotten my head around how to separate those two aspects of the tests yet. I think b9d5d2b looks like one of the refactors you mention, though? (test-performance-related, going by the commit message, and removes the app test fixture)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants