Skip to content
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

Enhance verbose output of conformance client and enable stream conformance tests #212

Merged
merged 4 commits into from
Jan 31, 2024

Conversation

jhump
Copy link
Member

@jhump jhump commented Jan 30, 2024

This adds verbose output features to the conformance client. There are now 5 levels of verbosity -- -v, -vv, and -vvv can be used to turn on the first three; -v 4 and -v 5 can be used to turn on the heavier trace output.

I used this output, along with a newly added --trace flag to the conformance test runner, to troubleshoot the streaming failures. (This PR, #210, and #211 represent all of the changes made to get everything to work.)

The levels of verbosity are:

  1. Prints the start and end of each test case. If an error occurs, prints the exception's stack trace.
  2. Prints exception stack traces for all RPC errors encountered and any errors that occur when calling send. (These could be expected errors, for tests of error conditions, which is why they are not enabled at verbosity 1).
  3. Prints the full messages read from stdin and results written to stdout (in protobuf text format). Also adds a tracing decorator to the HTTPClientInterface implementation, to print out each step in an RPC.
  4. Adds an okhttp event logger, to trace each step in the underlying HTTP framework.
  5. Turns on stack-trace logging for the above okhttp event logger and HTTPClientInterface tracing, so that each step shows its full stack trace (useful since some operations can happen from different threads).

This PR also applies some clean-up to the conformance configs and ... 🥁 ... enables all of the conformance tests! They now should all pass.

if (intVal == null || intVal < 1 || intVal > 5) {
throw RuntimeException("value for $arg option should be an integer between 1 and 5; instead got '$v'")
}
verbosity = intVal
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be in favor of just having -v <value>/-v (not -vv) or just -v <value> for simplicity.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

inetSocketAddress: InetSocketAddress,
proxy: Proxy,
protocol: Protocol?,
ioe: IOException,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to print the exception stack trace too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I didn't is because it wasn't really useful. These errors propagate to the caller, which means these exceptions already get logged elsewhere at just verbosity 1 or 2.

@jhump jhump force-pushed the jh/enable-stream-conformance-tests branch from c8e4b1c to 7fad0d7 Compare January 31, 2024 04:21
Base automatically changed from jh/minor-cleanup to main January 31, 2024 12:38
@jhump jhump force-pushed the jh/enable-stream-conformance-tests branch from 7fad0d7 to e416c20 Compare January 31, 2024 12:41
@jhump jhump merged commit 328110c into main Jan 31, 2024
7 checks passed
@jhump jhump deleted the jh/enable-stream-conformance-tests branch January 31, 2024 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants