GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: ensure proper cleanup of publisher in tests by hannahrogers-google · Pull Request #310 · googleapis/java-pubsub

This repository was archived by the owner on Aug 13, 2026. It is now read-only.

Conversation

@hannahrogers-google

@hannahrogers-google hannahrogers-google commented Aug 7, 2020

Copy link
Copy Markdown
Contributor

Our PublisherImplTest is taking over 5 minutes to run because we are not properly shutting down the publisher/testChannel. This PR ensures everything is shutdown properly, and decreases the test time to 10 seconds. Additional details provided in #309.

Fixes #309 ☕️

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
hannahrogers-google added 30 commits November 25, 2019 10:04
@hannahrogers-google
Modifying Publish example in README to match other examples given, and
19dd129
fix issue #6784
@hannahrogers-google
fix: Modifying Publish example in README to match other examples, and
4158529
fix Issue googleapis#11
@hannahrogers-google
Merge branch 'master' of github.com:hannahrogers-google/java-pubsub
7d704f0
@hannahrogers-google
Merge branch 'master' of https://github.com/googleapis/java-pubsub
9e0ebc6
@hannahrogers-google
feat: Adding support for DLQs
01d41b7
Adding delivery attempt count to PubsubMessages as a message attribute,
and creating helper function to allow users to get the count without
knowing implementation details.
@hannahrogers-google
Fix formatting
ed3b1ee
@hannahrogers-google
fix: making changes requested in pull request
72f7996
@hannahrogers-google
Merge branch 'master' of https://github.com/googleapis/java-pubsub
389cb86
@hannahrogers-google
Merge branch 'master' of https://github.com/googleapis/java-pubsub
c9e4bd2
@hannahrogers-google
fix: creating fix to not populate delivery attempt attribute when dead
3738ec8
lettering is not enabled
@hannahrogers-google
Merge branch 'master' of https://github.com/googleapis/java-pubsub
4ce1d3b
@hannahrogers-google
Adding unit test for case in which a received message has no delivery…
aecd4ca
… attempt
@hannahrogers-google
Making MessageWaiter class more generic to also be used for outstanding
77fa3b3
ack operations
@hannahrogers-google
Merge branch 'master' of https://github.com/googleapis/java-pubsub
b87023c
@hannahrogers-google
Merge branch 'master' into fix-subscriber-stop
7086b3c
@hannahrogers-google
Waiting for acks to complete before shutting down a streaming subscriber
da0e355
connection
@hannahrogers-google
Fixing formatting error
dc55fc1
@hannahrogers-google
Merge branch 'master' of https://github.com/googleapis/java-pubsub
45beee2
@hannahrogers-google
fix: making sure all publishes complete before shutting down the
548b7a7
publisher
@hannahrogers-google
Merge branch 'master' of https://github.com/googleapis/java-pubsub
76a1de9
@hannahrogers-google
Merge branch 'master' of https://github.com/googleapis/java-pubsub
a8989f1
@hannahrogers-google
adding default max outstanding request bytes
b4439fd
@hannahrogers-google
Merge branch 'master' of https://github.com/googleapis/java-pubsub
01f607c
@hannahrogers-google
Merge branch 'master' of https://github.com/googleapis/java-pubsub
c0cddb3
@hannahrogers-google
fix: make push endpoint valid https
9a6381d
@hannahrogers-google
Merge branch 'master' of https://github.com/googleapis/java-pubsub
0bd165f
@hannahrogers-google
Merge branch 'master' of https://github.com/googleapis/java-pubsub
5d47be8
@hannahrogers-google
Merge branch 'master' of https://github.com/googleapis/java-pubsub in…
e3b7f6d
…to master
@hannahrogers-google
Merge branch 'master' of https://github.com/googleapis/java-pubsub in…
6c1a26c
…to master
@hannahrogers-google
fix: use default zero value if a flow control setting is not provided
f2fa6b8
hannahrogers-google added 4 commits July 23, 2020 14:40
@hannahrogers-google
fix lint issues
0cd08dc
@hannahrogers-google
Merge branch 'master' of https://github.com/googleapis/java-pubsub in…
9ba9764
…to master
@hannahrogers-google
Merge branch 'master' of https://github.com/googleapis/java-pubsub
f52eb61
@hannahrogers-google
fix: better cleanup during publisher test
78d98e8
@hannahrogers-google
hannahrogers-google requested a review from kamalaboulhosn August 7, 2020 00:02
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Aug 7, 2020
@hannahrogers-google hannahrogers-google added kokoro:force-run Add this label to force Kokoro to re-run the tests. and removed cla: yes This human has signed the Contributor License Agreement. labels Aug 7, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 7, 2020
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Aug 7, 2020
@codecov

codecov Bot commented Aug 7, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

Merging #310 into master will decrease coverage by 0.06%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #310      +/-   ##
============================================
- Coverage     79.28%   79.21%   -0.07%     
+ Complexity      319      318       -1     
============================================
  Files            21       21              
  Lines          2892     2892              
  Branches        155      155              
============================================
- Hits           2293     2291       -2     
- Misses          535      536       +1     
- Partials         64       65       +1     
Impacted Files Coverage Δ Complexity Δ
...ain/java/com/google/cloud/pubsub/v1/Publisher.java 87.50% <0.00%> (-0.50%) 45.00% <0.00%> (-1.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dda3079...35c2c6e. Read the comment docs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hannahrogers-google
fix: format issues
785c3ee
@hannahrogers-google hannahrogers-google added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 7, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 7, 2020
@hannahrogers-google
hannahrogers-google requested a review from hongalex August 19, 2020 20:08
hongalex
hongalex reviewed Aug 19, 2020
View reviewed changes
Comment thread google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/PublisherImplTest.java

private void shutdownTestPublisher(Publisher publisher) throws InterruptedException {
publisher.shutdown();
fakeExecutor.advanceTime(Duration.ofSeconds(10));

@hongalex hongalex Aug 19, 2020

Copy link
Copy Markdown
Member

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.

How was 10 seconds chosen? Specifically, how long does this test need to execute on average?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@hannahrogers-google hannahrogers-google Aug 20, 2020

Copy link
Copy Markdown
Contributor Author

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.

The gax layer implements a Watchdog (https://github.com/googleapis/gax-java/blob/master/gax/src/main/java/com/google/api/gax/rpc/Watchdog.java) that periodically garbage collects idle streams. The check is scheduled at a fixed rate every 10 seconds. So, I chose 10 seconds to ensure that the watchdog check completes, otherwise we have to wait the full timeout.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
hannahrogers-google added 2 commits August 20, 2020 07:48
@hannahrogers-google
Merge branch 'master' of https://github.com/googleapis/java-pubsub
dbe753f
@hannahrogers-google
fix: test timeouts should be a minute
35c2c6e
@product-auto-label product-auto-label Bot added the api: pubsub Issues related to the googleapis/java-pubsub API. label Aug 21, 2020
kamalaboulhosn
kamalaboulhosn approved these changes Aug 24, 2020
View reviewed changes
@hannahrogers-google
hannahrogers-google merged commit b2b2f86 into googleapis:master Aug 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

2 more reviewers
@hongalex hongalex hongalex left review comments
@kamalaboulhosn kamalaboulhosn kamalaboulhosn approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

api: pubsub Issues related to the googleapis/java-pubsub API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Client library tests taking too long to complete

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@hannahrogers-google @kamalaboulhosn @hongalex @yoshi-kokoro
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.