Skip to content

tests: pubsub: fix flakiness - #759

Merged
stephenplusplus merged 1 commit into
googleapis:masterfrom
stephenplusplus:spp--pubsub-flakiness
Jul 30, 2015
Merged

tests: pubsub: fix flakiness#759
stephenplusplus merged 1 commit into
googleapis:masterfrom
stephenplusplus:spp--pubsub-flakiness

Conversation

@stephenplusplus

Copy link
Copy Markdown
Contributor

We've had issues with Pub/Sub tests flaking out, and today we ran into them again: https://travis-ci.org/GoogleCloudPlatform/gcloud-node/builds/73278785#L3237

What appears to be happening is when we pull for a message with returnImmediately:false, no messages are ever returned, and the test times out.

History:
#332
#377

The way it was working until today seemed cleaner, which was basically:

publishMessage(function(){pullMessage(function(){// run tests about the message here})})

We used to run them like this:

pullMessage(function(){// long-running until a message returns})publishMessage()xexactly6

This PR runs them like this:

beforeTestsRun(function(){publishMessage()x10})test(function(){pullMessage(function(){// run tests about the message here})})test(function(){pullMessage(function(){// run tests about the message here})})// etc...

I played with the ordering of publishes and pulls, with returnImmediately to true and false, with different amounts of messages (anywhere from 1-10), with publishing multiple messages in one API call vs many, and this was the only combination of all of the above that I could find that worked.

@tmatsuo -- your wisdom is very welcome :)

@stephenplusplusstephenplusplus added api: pubsub Issues related to the Pub/Sub API. testing labels Jul 30, 2015
@googlebotgooglebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 30, 2015
@callmehiphop

Copy link
Copy Markdown
Contributor

Looks good to me!

stephenplusplus added a commit that referenced this pull request Jul 30, 2015
@stephenplusplus
stephenplusplus merged commit 5ea6403 into googleapis:masterJul 30, 2015
sofisl added a commit that referenced this pull request Nov 9, 2022
Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com>
sofisl pushed a commit that referenced this pull request Jan 17, 2023
miguelvelezsa pushed a commit that referenced this pull request Jul 23, 2025
BREAKING CHANGE: use Node.js v10+
miguelvelezsa pushed a commit that referenced this pull request Jul 23, 2025
🤖 I have created a release \*beep\* \*boop\* ---
## [2.0.0](https://www.github.com/googleapis/gax-nodejs/compare/v1.14.2...v2.0.0) (2020-03-26)
### ⚠ BREAKING CHANGES
* use Node.js v10+
* throw for versions of Node.js older than v10.0.0 (#748)
* stop accepting Promise constructor (#737)
### Features
* export bundle descriptor in descriptors interface ([#744](https://www.github.com/googleapis/gax-nodejs/issues/744)) ([b1eccf9](https://www.github.com/googleapis/gax-nodejs/commit/b1eccf96c439d67376d249a54c9d22ffe7ff1839))
* export ServiceError from @grpc/grpc-js ([#754](https://www.github.com/googleapis/gax-nodejs/issues/754)) ([24a4d60](https://www.github.com/googleapis/gax-nodejs/commit/24a4d600738a9597e9a87d6705eaed3dc2285e3b))
* stop accepting Promise constructor ([#737](https://www.github.com/googleapis/gax-nodejs/issues/737)) ([816bf9b](https://www.github.com/googleapis/gax-nodejs/commit/816bf9b283217208debd979e893a6daf29f1f739))
* support async iterator for paging method ([#708](https://www.github.com/googleapis/gax-nodejs/issues/708)) ([3ac5afb](https://www.github.com/googleapis/gax-nodejs/commit/3ac5afb3b1b1b22798f15ee07395f3ca765383b4))
* throw for versions of Node.js older than v10.0.0 ([#748](https://www.github.com/googleapis/gax-nodejs/issues/748)) ([511fc23](https://www.github.com/googleapis/gax-nodejs/commit/511fc233bd66d537c24743ef460ee8c609cd551f))
### Bug Fixes
* **deps:** update dependency @grpc/grpc-js to ^0.7.0 ([#736](https://www.github.com/googleapis/gax-nodejs/issues/736)) ([01c428c](https://www.github.com/googleapis/gax-nodejs/commit/01c428cb1240320b92778abf1297a5ff72346fd9))
* **deps:** use @grpc/grpc-js v0.7.2 ([#735](https://www.github.com/googleapis/gax-nodejs/issues/735)) ([836e81b](https://www.github.com/googleapis/gax-nodejs/commit/836e81b64f84d8c118e6aea0580f0645658a8490))
* **deps:** use protobuf.js v6.8.9 ([#743](https://www.github.com/googleapis/gax-nodejs/issues/743)) ([fab91ce](https://www.github.com/googleapis/gax-nodejs/commit/fab91ce334d76212d7e31b5478331339c5acad76))
* allow passing numbers as path template parameters ([#756](https://www.github.com/googleapis/gax-nodejs/issues/756)) ([c466d3d](https://www.github.com/googleapis/gax-nodejs/commit/c466d3dc68c8f9050d3ae69dcedd708e3509ae17))
### Miscellaneous Chores
* require Node.js v10+ ([#759](https://www.github.com/googleapis/gax-nodejs/issues/759)) ([23ec7f6](https://www.github.com/googleapis/gax-nodejs/commit/23ec7f69c3813f6d06ea8b2a473d072337e1b499))
---
This PR was generated with [Release Please](https://github.com/googleapis/release-please).
miguelvelezsa pushed a commit that referenced this pull request Jul 23, 2025
* chore: use gts v2 (#757)
googleapis/gax-nodejs@247aeb7
commit 247aeb7668c4787596aeaea22f727549bcdf068d
Author: Alexander Fenster <fenster@google.com>
Date: Thu Mar 26 13:04:10 2020 -0700
chore: use gts v2 (#757)
* chore: use gts v2
* chore: ahhhhh thaaaats why
* chore: do not run on node8
* fix: new gts rules
* build: use TypeScript ^3.8.3, set lib to es2018 (#760)
googleapis/gax-nodejs@41c73f8
commit 41c73f886e0106d0d7b1b851b4823990495d8fc7
Author: Alexander Fenster <fenster@google.com>
Date: Thu Mar 26 13:34:19 2020 -0700
build: use TypeScript ^3.8.3, set lib to es2018 (#760)
* build: use TypeScript ^3.8.3, set lib to es2018
* fix: better typing
* chore!: require Node.js v10+ (#759)
googleapis/gax-nodejs@23ec7f6
commit 23ec7f69c3813f6d06ea8b2a473d072337e1b499
Author: Alexander Fenster <fenster@google.com>
Date: Thu Mar 26 14:07:14 2020 -0700
chore!: require Node.js v10+ (#759)
BREAKING CHANGE: use Node.js v10+
* chore(deps): update dependency @types/rimraf to v3 (#751)
googleapis/gax-nodejs@2f1b6ae
commit 2f1b6aedbbd620a1e9872b858e58264056344571
Author: WhiteSource Renovate <bot@renovateapp.com>
Date: Thu Mar 26 22:27:20 2020 +0100
chore(deps): update dependency @types/rimraf to v3 (#751)
Co-authored-by: Alexander Fenster <fenster@google.com>
* chore: release 2.0.0 (#738)
googleapis/gax-nodejs@1c11c80
commit 1c11c8015f93a6a711a9f113105d027095a3d90c
Author: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Date: Thu Mar 26 22:32:20 2020 +0000
chore: release 2.0.0 (#738)
🤖 I have created a release \*beep\* \*boop\*
---
## [2.0.0](https://www.github.com/googleapis/gax-nodejs/compare/v1.14.2...v2.0.0) (2020-03-26)
### ⚠ BREAKING CHANGES
* use Node.js v10+
* throw for versions of Node.js older than v10.0.0 (#748)
* stop accepting Promise constructor (#737)
### Features
* export bundle descriptor in descriptors interface ([#744](https://www.github.com/googleapis/gax-nodejs/issues/744)) ([b1eccf9](https://www.github.com/googleapis/gax-nodejs/commit/b1eccf96c439d67376d249a54c9d22ffe7ff1839))
* export ServiceError from @grpc/grpc-js ([#754](https://www.github.com/googleapis/gax-nodejs/issues/754)) ([24a4d60](https://www.github.com/googleapis/gax-nodejs/commit/24a4d600738a9597e9a87d6705eaed3dc2285e3b))
* stop accepting Promise constructor ([#737](https://www.github.com/googleapis/gax-nodejs/issues/737)) ([816bf9b](https://www.github.com/googleapis/gax-nodejs/commit/816bf9b283217208debd979e893a6daf29f1f739))
* support async iterator for paging method ([#708](https://www.github.com/googleapis/gax-nodejs/issues/708)) ([3ac5afb](https://www.github.com/googleapis/gax-nodejs/commit/3ac5afb3b1b1b22798f15ee07395f3ca765383b4))
* throw for versions of Node.js older than v10.0.0 ([#748](https://www.github.com/googleapis/gax-nodejs/issues/748)) ([511fc23](https://www.github.com/googleapis/gax-nodejs/commit/511fc233bd66d537c24743ef460ee8c609cd551f))
### Bug Fixes
* **deps:** update dependency @grpc/grpc-js to ^0.7.0 ([#736](https://www.github.com/googleapis/gax-nodejs/issues/736)) ([01c428c](https://www.github.com/googleapis/gax-nodejs/commit/01c428cb1240320b92778abf1297a5ff72346fd9))
* **deps:** use @grpc/grpc-js v0.7.2 ([#735](https://www.github.com/googleapis/gax-nodejs/issues/735)) ([836e81b](https://www.github.com/googleapis/gax-nodejs/commit/836e81b64f84d8c118e6aea0580f0645658a8490))
* **deps:** use protobuf.js v6.8.9 ([#743](https://www.github.com/googleapis/gax-nodejs/issues/743)) ([fab91ce](https://www.github.com/googleapis/gax-nodejs/commit/fab91ce334d76212d7e31b5478331339c5acad76))
* allow passing numbers as path template parameters ([#756](https://www.github.com/googleapis/gax-nodejs/issues/756)) ([c466d3d](https://www.github.com/googleapis/gax-nodejs/commit/c466d3dc68c8f9050d3ae69dcedd708e3509ae17))
### Miscellaneous Chores
* require Node.js v10+ ([#759](https://www.github.com/googleapis/gax-nodejs/issues/759)) ([23ec7f6](https://www.github.com/googleapis/gax-nodejs/commit/23ec7f69c3813f6d06ea8b2a473d072337e1b499))
---
This PR was generated with [Release Please](https://github.com/googleapis/release-please).
* fix(deps): update dependency google-auth-library to v6 (#763)
googleapis/gax-nodejs@72114db
commit 72114db1b15af3034c51a784e3fc619e2ee281e5
Author: WhiteSource Renovate <bot@renovateapp.com>
Date: Sat Mar 28 04:08:38 2020 +0100
fix(deps): update dependency google-auth-library to v6 (#763)
* fix: make async iteration work for gRPC-fallback; refactor the code (#765)
googleapis/gax-nodejs@944c06b
commit 944c06b4225c4dd5cdcf08e4ca2497cfe3a69cde
Author: Alexander Fenster <fenster@google.com>
Date: Fri Mar 27 22:19:15 2020 -0700
fix: make async iteration work for gRPC-fallback; refactor the code (#765)
* chore: release 2.0.1 (#766)
googleapis/gax-nodejs@3ce902d
commit 3ce902d94f6112853df4098b50ca46bb228a69b5
Author: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Date: Sat Mar 28 05:30:07 2020 +0000
chore: release 2.0.1 (#766)
🤖 I have created a release \*beep\* \*boop\*
---
### [2.0.1](https://www.github.com/googleapis/gax-nodejs/compare/v2.0.0...v2.0.1) (2020-03-28)
### Bug Fixes
* **deps:** update dependency google-auth-library to v6 ([#763](https://www.github.com/googleapis/gax-nodejs/issues/763)) ([72114db](https://www.github.com/googleapis/gax-nodejs/commit/72114db1b15af3034c51a784e3fc619e2ee281e5))
* make async iteration work for gRPC-fallback; refactor the code ([#765](https://www.github.com/googleapis/gax-nodejs/issues/765)) ([944c06b](https://www.github.com/googleapis/gax-nodejs/commit/944c06b4225c4dd5cdcf08e4ca2497cfe3a69cde))
---
This PR was generated with [Release Please](https://github.com/googleapis/release-please).
* build: set AUTOSYNTH_MULTIPLE_COMMITS=true for context aware commits (#770)
googleapis/gax-nodejs@a1e4a3f
commit a1e4a3fd9877b1370869a919e1165ea69410f201
Author: Benjamin E. Coe <bencoe@google.com>
Date: Tue Mar 31 18:34:30 2020 -0700
build: set AUTOSYNTH_MULTIPLE_COMMITS=true for context aware commits (#770)
* fix: do not run node 8 CI (#456)
googleapis/synthtool@1b4cc80
commit 1b4cc80a7aaf164f6241937dd87f3bd1f4149e0c
Author: Alexander Fenster <fenster@google.com>
Date: Wed Mar 25 08:01:31 2020 -0700
fix: do not run node 8 CI (#456)
* fix: update template files for Node.js libraries (#463)
googleapis/synthtool@9982024
commit 99820243d348191bc9c634f2b48ddf65096285ed
Author: Alexander Fenster <fenster@google.com>
Date: Tue Mar 31 11:56:27 2020 -0700
fix: update template files for Node.js libraries (#463)
sofisl pushed a commit that referenced this pull request Feb 25, 2026
GautamSharda pushed a commit that referenced this pull request Mar 12, 2026
🤖 I have created a release *beep* *boop*
---
## [4.0.3](googleapis/nodejs-common@v4.0.2...v4.0.3) (2022-08-23)
### Bug Fixes
* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-common/issues/1546)) ([#758](googleapis/nodejs-common#758)) ([e619bf9](googleapis/nodejs-common@e619bf9))
---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
thiyaguk09 pushed a commit to thiyaguk09/google-cloud-node-fork that referenced this pull request Mar 18, 2026
GautamSharda pushed a commit that referenced this pull request Mar 23, 2026
This PR was generated using Autosynth. 🌈
Synth log will be available here:
https://source.cloud.google.com/results/invocations/cc99acfa-05b8-434b-9500-2f6faf2eaa02/targets
- [ ] To automatically regenerate this PR, check this box.
Source-Link: googleapis/synthtool@799d8e6
GautamSharda pushed a commit that referenced this pull request Mar 25, 2026
This PR was generated using Autosynth. 🌈
Synth log will be available here:
https://source.cloud.google.com/results/invocations/cc99acfa-05b8-434b-9500-2f6faf2eaa02/targets
- [ ] To automatically regenerate this PR, check this box.
Source-Link: googleapis/synthtool@799d8e6
shivanee-p pushed a commit that referenced this pull request Mar 27, 2026
This PR was generated using Autosynth. 🌈
Synth log will be available here:
https://source.cloud.google.com/results/invocations/cc99acfa-05b8-434b-9500-2f6faf2eaa02/targets
- [ ] To automatically regenerate this PR, check this box.
Source-Link: googleapis/synthtool@799d8e6
shivanee-p pushed a commit that referenced this pull request Mar 27, 2026
thiyaguk09 pushed a commit to thiyaguk09/google-cloud-node-fork that referenced this pull request May 5, 2026
This PR was generated using Autosynth. 🌈
Synth log will be available here:
https://source.cloud.google.com/results/invocations/cc99acfa-05b8-434b-9500-2f6faf2eaa02/targets
- [ ] To automatically regenerate this PR, check this box.
Source-Link: googleapis/synthtool@799d8e6
thiyaguk09 pushed a commit to thiyaguk09/google-cloud-node-fork that referenced this pull request May 5, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: pubsubIssues related to the Pub/Sub API.cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@stephenplusplus@callmehiphop@googlebot