flaky unit test: test_numfig_disabled_warn
Describe the bug
Purpose
Recently the test_numfig_disabled_warn test case has been flaky; although some of the intermittent failures have been noted for docutils HEAD, I've also noticed it occurring with other versions of docutils too.
Some example failure logs include:
-
docutilsHEAD: https://github.com/sphinx-doc/sphinx/actions/runs/18772174723/job/53603139421#step:10:4828 -
docutilsv0.20: https://github.com/sphinx-doc/sphinx/actions/runs/19662374866/job/56311219423#step:10:4879
cc @jfbu @haampie @AA-Turner
How to Reproduce
We are not yet certain how to replicate this problem locally. It does appear intermittently in our GitHub Actions continuous integration testing.
Environment Information
TBD
Sphinx extensions
N/A
Additional context
- Related to #13996.
- Related to #14100 (flawed attempt at a fix).
The earliest instance of this test failure occurring that I can currently find is from 2025-10-12, against commit f224e043bc4227c2e27a5e11937d68dc4e291361 -- but it is likely to have begun occurring earlier (that commit doesn't seem likely to be related): https://github.com/sphinx-doc/sphinx/actions/runs/18444493274/job/52549289621#step:8:4856