-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create memhttp package to debug flaky testcases (#594)
Creates two internal packages: `memhttp` and `memhttptest` based on https://github.com/akshayjshah/memhttp . We use this for testing connect's services. Changes`httptest.Server` to use an in memory network. This makes testing more robust to ephemeral port issues under load. Two flaky test cases were now easily reproducible and fixed. Both occurred from races between starting the network request in a go routine and checking for a http2 stream and erroring if not. This can error on Send or Receive depending on how fast the request can complete. On `duplexHTTPCall` I removed `SetError` to avoid overwriting the original response error. Now `BlockUntilResponseReady` returns an error from the response initialization. See: golang/go#14200 Fixes: - `TestServer/http1/*/*/cumsum_cancel_before_send`: send can error on write message. - `TestBidiRequiresHTTP2`: send can `io.EOF` error on write, or succeed. - `TestBidiOverHTTP1`: same as above. - `TestClientPeer/grpcweb`: stream request sends an invalidate payload invoking server error, races with interceptor. Two places where errors raced: - https://github.com/connectrpc/connect-go/blob/525cf76ebd3c1c54f2cfd2cb4413c44b57539be9/duplex_http_call.go#L290 - https://github.com/connectrpc/connect-go/blob/525cf76ebd3c1c54f2cfd2cb4413c44b57539be9/handler.go#L184
- Loading branch information
1 parent
734ea94
commit 41e8e3b
Showing
20 changed files
with
810 additions
and
488 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.