-
Notifications
You must be signed in to change notification settings - Fork 56
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
chore: Clean up resources in gRPCStreamDirectController and ChannelPool tests #1691
Conversation
[gapic-generator-java-root] Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
@@ -241,12 +253,14 @@ public void channelPrimerIsCalledPeriodically() throws IOException { | |||
// 1 more call during channel refresh | |||
Mockito.verify(mockChannelPrimer, Mockito.times(3)) | |||
.primeChannel(Mockito.any(ManagedChannel.class)); | |||
pool.shutdown(); |
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.
Since this test is a unit test for ChannelPool
, I would assume every test is creating its own channel pool, so it's worth it to extract pool
to a field, the ndo shutdown and awaitTermination in a clean up method.
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.
Ah! Good point. Updating.
[java_showcase_integration_tests] Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
[java_showcase_unit_tests] Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
…essor job (#1691) (#1007) * chore: install dependencies through requirements file Source-Link: https://github.com/googleapis/synthtool/commit/35f4cbaf1295a726cb43fd4471129ec74b48e04e Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:821ab7aba89af2c7907e29297bba024d4cd5366d0684e5eb463391cdf4edc9ee
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.
LGTM. Separately, I would like to understand what exactly this test is testing and maybe we can remove some of the test cases. e.g. Looks like we are using a fake server in unit test for testing RetrySettings, which is essentially a local server integration tests that is already covered by showcase tests.
Good point. I think we are due for an audit for a gax's unit tests. This test pre-dates the showcase test suite so the mock server may not be needed anymore. I'll create a generic issue for auditing and cleaning up the unit tests. This PR is intended only to hopefully mitigate this flaky test. In the future, we may determine that this unit test is unnecessary. |
Created an issue at #1771 |
Clean up the resources that are created in the the GrpcDirectStreamControllerTest and ChannelPool tests.
Fixes: #1704