New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust farmer service SSL tests for increased reliability #17921
Open
emlowe
wants to merge
11
commits into
main
Choose a base branch
from
EL.ssl-hacks
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+88
−6
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
emlowe
added
CI
CI changes
Changed
Required label for PR that categorizes merge commit message as "Changed" for changelog
labels
Apr 30, 2024
emlowe
changed the title
Trying some SSL hacks for tests
Adjust SSL tests for increased reliability
Apr 30, 2024
emlowe
changed the title
Adjust SSL tests for increased reliability
Adjust farmer service SSL tests for increased reliability
Apr 30, 2024
altendky
requested changes
May 3, 2024
Pull Request Test Coverage Report for Build 8944179727Details
💛 - Coveralls |
altendky
approved these changes
May 3, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, the SSL tests specifically one test for the farmer is flaky - this seems to have been recently introduced possibly due to changes in aiohttp, but the exact reasons for flakiness are unknown
The end goal of the test is to make sure the server rejects the SSL connection - it seems that due to aiohttp internals, SSL errors are typically silent on the server and the client may not get a consistent error for why the connection was dropped. (see aio-libs/aiohttp#7325)
Adjust the flaky test as follows:
Using asyncio
debug
mode and setting the test to capture the log, we can look for the SSL certificate failure in the log files as it is output when asyncio is in debug mode. This is further complicated in that on some platforms, when asyncio is in debug mode, an exception is raised that is not catchable by pytest and fails the test - so a new exception handler is used to ignore the SSL exception, as we are only testing the log output.This is currently very stable in CI. This replaces the fix in #17899
I think the value of this particular test is debatable; I currently don't think there is any way to misconfigure the code such that this test would pass - it would have to be some error in SSL, or if all SSL cert verification was turned off.