Skip to content

flaky unit test: test_n_slowest_value - regex may not match slowest-read docname #14109

Closed

Description

@jayaddison

Describe the bug

The test_n_slowest_value test failed as a one-off while we were attempting to fix another flaky test in pull request #14107: https://github.com/sphinx-doc/sphinx/actions/runs/19748819758/job/56588233131?pr=14107#step:10:5014

        matches = re.findall(r'\d+\.\d{3}s\s+[A-Za-z0-9]+\n', app.status.getvalue())
>       assert len(matches) == 2
E       AssertionError: assert 1 == 2
E        +  where 1 = len(['0.139s markup\n'])

It seems that this regex failed due to the slowest-reading-duration output that contains a timing for a docname with a directory path separator:

====================== slowest reading durations =======================
0.256s subdir/includes
0.139s markup

How to Reproduce

$ git checkout 4ea0d9fef464390694cc600fda89a924c2336b69
$ rm tests/roots/test-root/*.txt
$ touch tests/roots/test-root/index.txt
$ pytest tests/test_extensions/test_ext_duration.py

Environment Information

Platform:              linux; (Linux-6.17.8+deb14-amd64-x86_64-with-glibc2.41)
Python version:        3.13.9 (main, Oct 15 2025, 14:56:22) [GCC 15.2.0])
Python implementation: CPython
Sphinx version:        9.0.0+/4ea0d9fef
Docutils version:      0.22.3
Jinja2 version:        3.1.6
Pygments version:      2.19.2

Sphinx extensions

N/A

Additional context

Edit: add additional-context reference.
Edit: add code block around repro steps, and annotate as shell-script syntax

Activity

  1. locked as resolved and limited conversation to collaborators on Dec 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions