tests: fix flaky test_serialization #5288
Merged
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.
Release Summary:
Resolved issues:
Part 2 of #5282
Our integ tests have been failing more often lately. I suspect it's a Codebuild noisy neighbor problem. The main tests I see fail are "test_renegotiate" and "test_serialization". I ran the integ tests on an ec2 instance also running
stress
. It was almost comically effective. I was able to consistently repro the failures from the CI.#5282 fixed test_renegotiate. This PR fixes test_serialization.
Description of changes:
We don't shutdown connections when serializing. It wouldn't really make sense, since closing a connection involves sending and receiving data and sending and receiving data changes the state of the connection so that the serialization is no longer valid. So we skip s2n_shutdown: https://github.com/aws/s2n-tls/blob/main/bin/s2nc.c#L804-L808
However, if a connection has completed a handshake and is just idling on
echo
, then we're calling s2n_send / s2n_recv. So when the peer closes the underlying TCP connection because the process ended, we receive that EOF event and throw an error for improper shutdown of the TLS connection.The fix is not to call
echo
, since we're not sending or receiving anything anyway.Testing:
Hard to prove lack of flakiness. But it now passes locally with
stress
running.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.