Skip to content

Conversation

@glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented Jul 20, 2020

Motivation:

In #902 we changed behaviour such that gRPC will not log unless you
explicitly pass in a logger. When tests fail it's useful to have the
logs to triage them, especially when they fail under CI, for example.

Modifications:

  • Add a capturing log handler factory to the test module which captures
    all logs emitted by handlers it makes
  • Wire up loggers in tests
  • Hook up GRPCTestCase to print the captured logs only if a test fails
    (or an environment variable was set)
  • Add a bunch of missing super.setUp and super.tearDown calls

Result:

  • If a test fails we get all .trace level logs emitted during that
    test

Motivation:

In grpc#902 we changed behaviour such that gRPC will not log unless you
explicitly pass in a logger. When  tests fail it's useful to have the
logs to triage them, especially when they fail under CI, for example.

Modifications:

- Add a capturing log handler factory to the test module which captures
  all logs emitted by handlers it makes
- Wire up loggers in tests
- Hook up `GRPCTestCase` to print the captured logs only if a test fails
  (or an environment variable was set)
- Add a bunch of missing `super.setUp` and `super.tearDown` calls

Result:

- If a test fails we get all `.trace` level logs emitted during that
  test
@glbrntt glbrntt added the semver/none No version bump required. label Jul 20, 2020
@glbrntt glbrntt requested a review from Lukasa July 20, 2020 14:56
@glbrntt glbrntt merged commit d27c298 into grpc:master Jul 20, 2020
@glbrntt glbrntt deleted the gb-capture-test-logs branch July 20, 2020 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver/none No version bump required.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants