Add sockets streams suite - #7180
Open
jasnell wants to merge 1 commit into
Open
Conversation
Comment on lines
+217
to
+222
| const socket = connect(greetAddress(env)); | ||
| const reader = socket.readable.getReader(); | ||
| await reader.read(); // take the greeting (or its first fragment) | ||
| await reader.cancel('done'); | ||
| await socket.close(); | ||
| ok(true); |
Contributor
There was a problem hiding this comment.
The greet peer has already sent EOF before reader.cancel() runs, so this passes if cancellation is a no-op; socket.close() then supplies the observed closure. Keep the peer open, cancel an actually pending read, and observe the public closed promise.
Suggested change
| const socket = connect(greetAddress(env)); | |
| const reader = socket.readable.getReader(); | |
| await reader.read(); // take the greeting (or its first fragment) | |
| await reader.cancel('done'); | |
| await socket.close(); | |
| ok(true); | |
| async test(ctrl, env) { | |
| const socket = connect(echoAddress(env)); | |
| await socket.opened; | |
| const reader = socket.readable.getReader(); | |
| const pendingRead = reader.read(); | |
| await reader.cancel('done'); | |
| await pendingRead; | |
| await socket.close(); | |
| await socket.closed; | |
| }, |
Contributor
|
I'm Bonk, and I've done a quick review of your PR. Adds a dual-implementation socket-streams test suite with TCP echo sidecars.
Verification could not complete: Bazel lacks libc++ headers in this runner. |
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.
More test consolidations.