Skip to content

tests: implement readiness check before yielding local-http(s) test servers - #12050

Merged
picnixz merged 19 commits into
sphinx-doc:masterfrom
jayaddison:issue-12038/increase-https-selfsigned-test-timeout
Mar 8, 2024
Merged

picnixz merged 19 commits into
sphinx-doc:masterfrom
jayaddison:issue-12038/increase-https-selfsigned-test-timeout

Conversation

@jayaddison

@jayaddison jayaddison commented Mar 7, 2024 •

Copy link
Copy Markdown
Contributor

Feature or Bugfix

  • Bugfix

Purpose

  • Intended to prevent a flaky test failure from causing false-positive failure notices in Sphinx's continuous integration tests on GitHub Actions.

Detail

  • Implements a socket-based readiness check on each test HTTP(S) server created for use during unit tests before yielding it for use by the corresponding test case.

Relates

@jayaddison jayaddison changed the title tests: increase timeout for linkcheck local-https test server tests: implement healthcheck before yielding local-http(s) test servers Mar 7, 2024
@jayaddison jayaddison changed the title tests: implement healthcheck before yielding local-http(s) test servers tests: implement readiness check before yielding local-http(s) test servers Mar 7, 2024
@jayaddison

Copy link
Copy Markdown
Contributor Author

I'm going to push a few more commits for this momentarily, including a changelog entry. But this code also needs to be evaluated on a large-batch of Windows CI unit test builds, to check that it's reliable.

@jayaddison
jayaddison requested a review from picnixz March 7, 2024 11:38
Comment thread .github/workflows/main.yml Resolved
Comment thread tests/utils.py Resolved
Comment thread tests/utils.py Resolved
@picnixz

picnixz commented Mar 7, 2024

Copy link
Copy Markdown
Member

If you want to check whether it's reliable or not and you don't have access to Windows, just commit a space diff, then commit without the space and again just to trigger the CI/CD

Comment thread tests/utils.py Outdated
server_thread.start()
try:
yield server_thread
socket.create_connection(ADDRESS, timeout=0.5).close() # attempt connection.

@picnixz picnixz Mar 7, 2024 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to end your sentences with periods you should also start with a capital letter (I think it's fine not to have a period for non-capitalized small comments in general)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, that's reasonable :)

The full-stop was partly to reduce the chance that one or other of the lines could be deleted, leaving the other one parse as valid but without the relevant context.

@picnixz

picnixz commented Mar 8, 2024

Copy link
Copy Markdown
Member

Is it fine to merge? I don't have anything else to say

@jayaddison

Copy link
Copy Markdown
Contributor Author

Is it fine to merge? I don't have anything else to say

I count 50 Python test builds on Windows without seeing the failure occur again - that gives me reasonable (although not complete) confidence that it's OK to merge. Even so, I'll monitor the test results on mainline and PRs for the next few weeks.

@jayaddison

Copy link
Copy Markdown
Contributor Author

Shorter answer: yes, I think so.

(but after this many attempts I still won't be surprised if another Windows test failure does occur somehow!)

@picnixz
picnixz merged commit 1bfddf8 into sphinx-doc:master Mar 8, 2024
@picnixz

picnixz commented Mar 8, 2024

Copy link
Copy Markdown
Member

Thank you!

@jayaddison

Copy link
Copy Markdown
Contributor Author

And thank you for the review and merge!

@jayaddison
jayaddison deleted the issue-12038/increase-https-selfsigned-test-timeout branch March 8, 2024 10:37
@jayaddison

Copy link
Copy Markdown
Contributor Author

I count 50 Python test builds on Windows without seeing the failure occur again - that gives me reasonable (although not complete) confidence that it's OK to merge. Even so, I'll monitor the test results on mainline and PRs for the next few weeks.

The same error message appeared again in #12065.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 12, 2024
@AA-Turner AA-Turner added this to the 7.3.0 milestone Jul 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flaky unit test: test_build_linkcheck.test_connect_to_selfsigned_fails

3 participants