Repository navigation
stabilize tests on Windows - #73
Open
sebastian-carpenter wants to merge 1 commit into
Open
sebastian-carpenter wants to merge 1 commit into
sebastian-carpenter wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the Windows TLS connection lifecycle test changes.
No open issues 🎉
What changed in this PR
This PR stabilizes TLS connection lifecycle tests on Windows without changing production code.
Changes:
- Skips final over-delivery assertions on Windows while preserving earlier timeout and stream-prefix checks.
- Drains post-handshake data before testing idle close, avoiding resets caused by unread data.
- Consolidates repeated draining logic into a shared helper with a bounded wait.
| File | Description |
|---|---|
wolftls/conn_lifecycle_test.go |
Adjusts Windows timeout assertions and shares post-handshake draining logic across lifecycle tests. |
Review effort: Balanced
This file contains hidden or 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
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.
Write-timeout tests: skip only the over-delivery check on Windows
TestReadAfterWriteTimeoutSendsNothing,TestLargeWriteTimeoutReportsDeliveredBytes, andTestWriteTimeoutKeepsStreamConsistentnow callskipExactWriteCountOnWindowsjust before their final "nothing arrived beyond the reported bytes" assertion.On Windows a write deadline cancels the in-flight overlapped
WSASend, and Go reports0, ErrDeadlineExceededeven when the kernel already sent the buffer. This check is undefined behavior on Windows.All earlier assertions still run on Windows:
net.ErrorWritefails again withn == 0TestIdleCloseWithoutDeadlinesSendsCloseNotify: drain beforeCloseThe client now reads the server's post-handshake messages before closing. Closing a socket that still holds unread data sends a RST. Linux still delivers data the peer has already received ahead of that RST, but Windows discards it, so the peer saw
WSAECONNRESETinstead of the close_notify.drainPostHandshakehelperBroke this out into a helper to reduce duplication.
Testing
Linux && Windows pass. Ran
go test -count=1 . ./handles ./sha256 ./wolftls ./wolfx509on both OS's.