Skip to content

Make some handshakes in tests less flaky.#1163

Merged
mhils merged 1 commit into
pyca:mainfrom
tjni:improve-handshake-tests
Dec 2, 2022
Merged

Make some handshakes in tests less flaky.#1163
mhils merged 1 commit into
pyca:mainfrom
tjni:improve-handshake-tests

Conversation

@tjni

@tjni tjni commented Dec 2, 2022

Copy link
Copy Markdown
Contributor

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

mhils commented Dec 2, 2022

Copy link
Copy Markdown
Member

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

@tjni

tjni commented Dec 2, 2022

Copy link
Copy Markdown
Contributor Author

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.

2 participants