Skip to content
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

Make some handshakes in tests less flaky. #1163

Merged
merged 1 commit into from Dec 2, 2022
Merged

Make some handshakes in tests less flaky. #1163

merged 1 commit into from Dec 2, 2022

Conversation

tjni
Copy link
Contributor

@tjni tjni commented Dec 2, 2022

The test test_set_keylog_callback (and a couple others) are consistently failing for me locally on my M1 Mac. I don't know exactly why this happens, but I hypothesize it's related to the non-blocking nature of the handshake and perhaps delays in my system while the handshake is taking place. By adding a select call to block when WantReadError is raised, I'm able to get these tests to pass on my machine.

In addition, I noticed pytest warning me that the sockets created in the _handshake_test method were not closed, so I'm wrapping the body of the method now in a with block.

@tjni tjni changed the title Make some handshake in tests less flaky. Make some handshakes in tests less flaky. Dec 2, 2022
@mhils
Copy link
Member

mhils commented Dec 2, 2022

Thanks, @tjni! FYI I'm tackling the 3.6 problem here already: #1164

@tjni
Copy link
Contributor Author

tjni commented Dec 2, 2022

Thank you! I like your approach better than mine. I'll rebase on top of that commit for the time being so that CI can run.

@mhils mhils merged commit 8a75898 into pyca:main Dec 2, 2022
@tjni tjni deleted the improve-handshake-tests branch December 2, 2022 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants