From 70a954e3d1af776c420f679a16c1f89ed6b41369 Mon Sep 17 00:00:00 2001 From: James Addison Date: Sat, 23 Mar 2024 17:40:58 +0000 Subject: [PATCH 1/5] [linkcheck] Introduce an artificial queue worker delay to help uncover a bad test assumption. --- sphinx/builders/linkcheck.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sphinx/builders/linkcheck.py b/sphinx/builders/linkcheck.py index 83f45e4719c..414adc4d8b0 100644 --- a/sphinx/builders/linkcheck.py +++ b/sphinx/builders/linkcheck.py @@ -320,6 +320,9 @@ def __init__(self, config: Config, def run(self) -> None: while True: next_check, hyperlink = self.wqueue.get() + import time + from random import randint + time.sleep(0.001 * (randint(0, 100) / 100)) if hyperlink is None: # An empty hyperlink is a signal to shutdown the worker; cleanup resources here self._session.close() From 30725a3558a75134ab06b17f892fac3e59e7ebf4 Mon Sep 17 00:00:00 2001 From: James Addison Date: Sat, 23 Mar 2024 17:53:01 +0000 Subject: [PATCH 2/5] [CI/CD] Temporarily remove py3.13-dev from the unit testing mix until Ubuntu Launchpad's infrastructure status is confirmed reliable again. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 77f59065763..d58a1de6c2f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,7 +36,7 @@ jobs: - "3.10" - "3.11" - "3.12" - - "3.13-dev" + # - "3.13-dev" # temporary: https://ubuntu.social/@launchpadstatus/112145930938639123 docutils: - "0.18" - "0.20" From 6a3d3d9c61033e88a843b00f662866b0b52b225c Mon Sep 17 00:00:00 2001 From: James Addison Date: Sat, 23 Mar 2024 18:17:53 +0000 Subject: [PATCH 3/5] [tests] linkcheck: remove order-of-result assumption from 'test_linkcheck_exclude_documents' test case. --- tests/test_builders/test_build_linkcheck.py | 35 ++++++++++----------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/tests/test_builders/test_build_linkcheck.py b/tests/test_builders/test_build_linkcheck.py index 4ac29a66797..d0f82f15d81 100644 --- a/tests/test_builders/test_build_linkcheck.py +++ b/tests/test_builders/test_build_linkcheck.py @@ -1011,21 +1011,20 @@ def test_linkcheck_exclude_documents(app): with open(app.outdir / 'output.json', encoding='utf-8') as fp: content = [json.loads(record) for record in fp] - assert content == [ - { - 'filename': 'broken_link.rst', - 'lineno': 4, - 'status': 'ignored', - 'code': 0, - 'uri': 'https://www.sphinx-doc.org/this-is-a-broken-link', - 'info': 'broken_link matched ^broken_link$ from linkcheck_exclude_documents', - }, - { - 'filename': 'br0ken_link.rst', - 'lineno': 4, - 'status': 'ignored', - 'code': 0, - 'uri': 'https://www.sphinx-doc.org/this-is-another-broken-link', - 'info': 'br0ken_link matched br[0-9]ken_link from linkcheck_exclude_documents', - }, - ] + assert len(content) == 2 + assert { + 'filename': 'broken_link.rst', + 'lineno': 4, + 'status': 'ignored', + 'code': 0, + 'uri': 'https://www.sphinx-doc.org/this-is-a-broken-link', + 'info': 'broken_link matched ^broken_link$ from linkcheck_exclude_documents', + } in content + assert { + 'filename': 'br0ken_link.rst', + 'lineno': 4, + 'status': 'ignored', + 'code': 0, + 'uri': 'https://www.sphinx-doc.org/this-is-another-broken-link', + 'info': 'br0ken_link matched br[0-9]ken_link from linkcheck_exclude_documents', + } in content From d90f9c8c3178ca90b16392940d57da94ae3709ed Mon Sep 17 00:00:00 2001 From: James Addison Date: Sun, 24 Mar 2024 09:46:29 +0000 Subject: [PATCH 4/5] Revert "[CI/CD] Temporarily remove py3.13-dev from the unit testing mix until Ubuntu Launchpad's infrastructure status is confirmed reliable again." This reverts commit 30725a3558a75134ab06b17f892fac3e59e7ebf4. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d58a1de6c2f..77f59065763 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,7 +36,7 @@ jobs: - "3.10" - "3.11" - "3.12" - # - "3.13-dev" # temporary: https://ubuntu.social/@launchpadstatus/112145930938639123 + - "3.13-dev" docutils: - "0.18" - "0.20" From 896cb085bdcfd25e45fdad37073c25f03940c063 Mon Sep 17 00:00:00 2001 From: James Addison Date: Sun, 24 Mar 2024 09:46:30 +0000 Subject: [PATCH 5/5] Revert "[linkcheck] Introduce an artificial queue worker delay to help uncover a bad test assumption." This reverts commit 70a954e3d1af776c420f679a16c1f89ed6b41369. --- sphinx/builders/linkcheck.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/sphinx/builders/linkcheck.py b/sphinx/builders/linkcheck.py index 414adc4d8b0..83f45e4719c 100644 --- a/sphinx/builders/linkcheck.py +++ b/sphinx/builders/linkcheck.py @@ -320,9 +320,6 @@ def __init__(self, config: Config, def run(self) -> None: while True: next_check, hyperlink = self.wqueue.get() - import time - from random import randint - time.sleep(0.001 * (randint(0, 100) / 100)) if hyperlink is None: # An empty hyperlink is a signal to shutdown the worker; cleanup resources here self._session.close()