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 — pubsub: fix testStartStopReset by pongad · Pull Request #1453 · googleapis/google-cloud-java

Conversation

@pongad

@pongad pongad commented Dec 7, 2016

Copy link
Copy Markdown
Contributor

The test verifies that calling stop() actually stops the emulator.
The previous implementation stops the emulator by

  • sending HTTP POST to /shutdown
  • terminating the emulator process
    The second step follows directly after the first.
    It then queries the server it just shut down to make sure it does not
    respond.

This behavior is incorrect for two reasons.

  • The server might continue serving request after responding to
    /shutdown.
  • The "emulator process" might not be the emulator at all.
    It might be a script that in-turn runs the emulator.
    On UNIX systems, killing a parent process does not kill any of its
    children; the actual emulator might run indefinitely after
    we kill the process we spawned.

This commit changes this behavior.
After POSTing to /shutdown, we simply wait for the spawned process
to terminate on its own.

Technically, there is still a race:
Another emulator could have been started on the same port.
When we send a request to verify that the old emulator has terminated,
we might get a response from the new one.
Since we execute tests sequentially though,
I believe this should not be a problem in practice.

Updates #1429.

Sorry, something went wrong.

Uh oh!

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

All reactions
@pongad
pubsub: fix testStartStopReset
55a7d1a
The test verifies that calling stop() actually stops the emulator.
The previous implementation stops the emulator by
- sending HTTP POST to /shutdown
- terminating the emulator process
The second step follows directly after the first.
It then queries the server it just shut down to make sure it does not
respond.

This behavior is incorrect for two reasons.
- The server might continue serving request after responding to
  /shutdown.
- The "emulator process" might not be the emulator at all.
  It might be a script that in-turn runs the emulator.
  On UNIX systems, killing a parent process does not kill any of its
  children; the actual emulator might run indefinitely after
  we kill the process we spawned.

This commit changes this behavior.
After POSTing to /shutdown, we simply wait for the spawned process
to terminate on its own.

Technically, there is still a race:
Another emulator could have been started on the same port.
When we send a request to verify that the old emulator has terminated,
we might get a response from the new one.
Since we execute tests sequentially though,
I believe this should not be a problem in practice.

Updates #1429.
@pongad pongad assigned garrettjonesgoogle Dec 7, 2016
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 7, 2016
@coveralls

coveralls commented Dec 7, 2016

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.008%) to 83.52% when pulling 55a7d1a on pongad:pubsub-test into b24ec1a on GoogleCloudPlatform:master.

All reactions

Sorry, something went wrong.

Uh oh!

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

garrettjonesgoogle
garrettjonesgoogle reviewed Dec 7, 2016
View reviewed changes
Comment thread google-cloud-core/src/main/java/com/google/cloud/testing/BaseEmulatorHelper.java Outdated
public void waitFor() throws InterruptedException {
if (process != null) {
process.destroy();
process.waitFor();

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

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

@pongad

pongad commented Dec 8, 2016

Copy link
Copy Markdown
Contributor Author

@garrettjonesgoogle PTAL, we now raises an exception if process has not finished in specified time.

All reactions

Sorry, something went wrong.

Uh oh!

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

@pongad
pr comments
84b12ba
raises exception if we cannot stop the emulator.
@coveralls

coveralls commented Dec 8, 2016

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.02%) to 83.534% when pulling 2927478 on pongad:pubsub-test into b24ec1a on GoogleCloudPlatform:master.

All reactions

Sorry, something went wrong.

Uh oh!

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

@coveralls

coveralls commented Dec 8, 2016

Copy link
Copy Markdown

Coverage Status

Changes Unknown when pulling 84b12ba on pongad:pubsub-test into ** on GoogleCloudPlatform:master**.

All reactions

Sorry, something went wrong.

Uh oh!

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

@garrettjonesgoogle
garrettjonesgoogle merged commit 4567c49 into googleapis:master Dec 8, 2016
@pongad
pongad deleted the pubsub-test branch December 12, 2016 03:33
github-actions Bot pushed a commit that referenced this pull request Aug 25, 2022
@release-please
chore(main): release 2.3.6 (#1453)
ec26e52
🤖 I have created a release *beep* *boop*
---


## [2.3.6](googleapis/java-bigquerydatatransfer@v2.3.5...v2.3.6) (2022-08-24)


### Dependencies

* update dependency com.google.cloud:google-cloud-pubsub to v1.120.13 ([#1452](googleapis/java-bigquerydatatransfer#1452)) ([29121bf](googleapis/java-bigquerydatatransfer@29121bf))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
chingor13 pushed a commit that referenced this pull request Jan 22, 2026
@renovate-bot
build(deps): update dependency org.codehaus.mojo:build-helper-maven-p…
6caf603
…lugin to v3.6.0 (#1453)
chingor13 pushed a commit that referenced this pull request Feb 24, 2026
@renovate-bot
chore(deps): update dependency com.google.cloud:google-iam-admin to v…
c83a71f
…3.42.0 (#1453)
chingor13 pushed a commit that referenced this pull request Mar 12, 2026
@renovate-bot
chore(deps): update dependency com.google.cloud:google-iam-admin to v…
df04b9e
…3.42.0 (#1453)
suztomo pushed a commit that referenced this pull request Mar 30, 2026
@release-please
chore(main): release 0.127.22 (#1453)
81afa65
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
lqiu96 pushed a commit that referenced this pull request Apr 1, 2026
@release-please
chore(main): release 0.127.22 (#1453)
326e75a
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
meltsufin pushed a commit that referenced this pull request Apr 29, 2026
@release-please
chore(main): release 1.123.1-SNAPSHOT (#1453)
06d5dec
🤖 I have created a release *beep* *boop*
---


### Updating meta-information for bleeding-edge SNAPSHOT release.

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
meltsufin pushed a commit that referenced this pull request May 1, 2026
@release-please
chore(main): release 1.123.1-SNAPSHOT (#1453)
94e9386
🤖 I have created a release *beep* *boop*
---


### Updating meta-information for bleeding-edge SNAPSHOT release.

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
benjaminp pushed a commit to benjaminp/google-cloud-java that referenced this pull request Jul 13, 2026
@release-please
chore(main): release 2.14.2-SNAPSHOT (googleapis#1453)
dffc2bd
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@garrettjonesgoogle garrettjonesgoogle garrettjonesgoogle left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

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

Assignees

@garrettjonesgoogle garrettjonesgoogle

Labels

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.

Uh oh!

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

4 participants

@pongad @coveralls @garrettjonesgoogle @googlebot
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.