-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add checks in referenceclient to validate raw gRPC-Web trailers and actual HTTP trailers #780
Conversation
0738a26
to
13c7660
Compare
55286a5
to
9c0b785
Compare
return errs | ||
} | ||
|
||
func checkGRPCWebTrailers(rawGRPCWebTrailers string, reportedTrailers []*conformancev1.Header) multiErrors { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be good to have unit tests for this. It seems sufficiently complex enough that we'd want to test it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I was being lazy programmer. I'll add tests.
9c0b785
to
a0c5006
Compare
@smaye81, okay, I've got this rebased now that all of the wire detail checks are just in the reference client. BTW, I think the best will be easiest to review one commit at a time (particularly because I renamed a file in the first commit, and viewing the diff for the whole PR shows it as one file removed and another added). I updated this to use the same "printer" abstraction that the reference server uses for logging issues, but instead of getting written to stderr, these get recorded into a I've also added a test with numerous cases, to verify the logic. And, admittedly, that logic got more complicated so that (1) it can handle different kinds of line endings and complain about them, (2) it can correctly handle "obsolete line folding" described in the spec and complain about it, and (3) validate the field name (in previous iteration, I somehow missed that, and it was only checking the value). |
aefbd29
to
dfb7e40
Compare
dfb7e40
to
c307412
Compare
// TODO | ||
} | ||
|
||
func examineGRPCEndStream(endStream string, printer internal.Printer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Holy cow, haha, this is great. This almost feels like it could be its own package to help others validate end streams.
…o some of the wire-details-related functions; fix racy behavior that can result in flaky failures with timeout test cases
@smaye81, I just pushed one more commit. Some stuff in that commit were a few small renames and additional doc comments in the wire details stuff, in the hopes of making things a little more clearly named and easier to read. But I also had to change the capture stuff from using an atomic pointer to using a channel to await the value being available. This is because, sadly, it can't be helped that sometimes there will be some raciness between the goroutine executing the HTTP operation and the RPC caller's goroutine for the timeout cases (only for client- and bidi-stream RPCs; for other kinds of RPCs, the HTTP operation is issued on the same goroutine as the RPC caller). See 6386c4c. |
This adds handling of the HTTP trailers and gRPC-Web end-stream messages to the reference client. When in reference mode, it will examine them and make sure they are appropriate, using stricter checks than connect-go (so we can't just rely on the base connect-go client implementation to raise these issues in the conformance results).