commit | d167be430d4b3fa0a035caa5bede32eff40f07ee | [log] [tgz] |
---|---|---|
author | Jean de Klerk <deklerk@google.com> | Wed Jul 10 16:33:07 2019 -0600 |
committer | Jean de Klerk <deklerk@google.com> | Mon Jul 15 15:48:42 2019 +0000 |
tree | c38ba5c9ee9478d7e33ac69882e10315b3c6e471 | |
parent | f5404d6c65b2a7a73e4914d7463b6342d6d676e2 [diff] |
pubsub: fix "log after test finished" failure This CL fixes a problem in pubsub's e2e test whereby a log can happen after the test is finished, since the test doesn't wait for the async consumer to finish before declaring the test completed. This CL fixes that by adding an explicit "done" to consumer.consume which the tests wait on. See: https://sponge.corp.google.com/target?id=c5050c57-9048-4b70-af8f-41bc4b627020&target=cloud-go-libraries/google-cloud-go/continuous/go112&searchFor=&show=FAILED&sortBy=STATUS ``` === RUN TestEndToEnd_LongProcessingTime 2019/07/10 18:55:35 quiesced --- PASS: TestEndToEnd_LongProcessingTime (148.68s) endtoend_test.go:266: 0: start receive PASS panic: Log in goroutine after TestEndToEnd_LongProcessingTime has completed goroutine 40333 [running]: testing.(*common).logDepth(0xc0002c6300, 0xc0005b84a0, 0x19, 0x3) /usr/local/go/src/testing/testing.go:634 +0x51a testing.(*common).log(...) /usr/local/go/src/testing/testing.go:614 testing.(*common).Logf(0xc0002c6300, 0xcf7981, 0x18, 0xc000219f88, 0x2, 0x2) /usr/local/go/src/testing/testing.go:649 +0x91 cloud.google.com/go/pubsub/internal/longtest.(*consumer).consume(0xc000299540, 0xde0b80, 0xc00034a120, 0xc0002c6300, 0xc000482320) /root/go/src/cloud.google.com/go/pubsub/internal/longtest/endtoend_test.go:269 +0x3e2 created by cloud.google.com/go/pubsub/internal/longtest.TestEndToEnd_LongProcessingTime /root/go/src/cloud.google.com/go/pubsub/internal/longtest/endtoend_test.go:179 +0x6b0 FAIL cloud.google.com/go/pubsub/internal/longtest 773.275s ``` Change-Id: I8009c0baf9647ef3a8ad3ece5aff7f9fc3b313d7 Reviewed-on: https://code-review.googlesource.com/c/gocloud/+/42690 Reviewed-by: Alex Hong <hongalex@google.com> Reviewed-by: kokoro <noreply+kokoro@google.com>
Go packages for Google Cloud Platform services.
import "cloud.google.com/go"
To install the packages on your system, do not clone the repo. Instead use
$ go get -u cloud.google.com/go/...
NOTE: Some of these packages are under development, and may occasionally make backwards-incompatible changes.
NOTE: Github repo is a mirror of https://code.googlesource.com/gocloud.
Alpha status: the API is still being actively developed. As a result, it might change in backward-incompatible ways and is not recommended for production use.
Beta status: the API is largely complete, but still has outstanding features and bugs to be addressed. There may be minor backwards-incompatible changes where necessary.
Stable status: the API is mature and ready for production use. We will continue addressing bugs and feature requests.
Documentation and examples are available at godoc.org/cloud.google.com/go
We support the two most recent major versions of Go. If Google App Engine uses an older version, we support that as well.
By default, each API will use Google Application Default Credentials for authorization credentials used in calling the API endpoints. This will allow your application to run in many environments without requiring explicit configuration.
client, err := storage.NewClient(ctx)
To authorize using a JSON key file, pass option.WithCredentialsFile
to the NewClient
function of the desired package. For example:
client, err := storage.NewClient(ctx, option.WithCredentialsFile("path/to/keyfile.json"))
You can exert more control over authorization by using the golang.org/x/oauth2
package to create an oauth2.TokenSource
. Then pass option.WithTokenSource
to the NewClient
function: snip:# (auth-ts)
tokenSource := ...
client, err := storage.NewClient(ctx, option.WithTokenSource(tokenSource))
Contributions are welcome. Please, see the CONTRIBUTING document for details. We‘re using Gerrit for our code reviews. Please don’t open pull requests against this repo, new pull requests will be automatically closed.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See Contributor Code of Conduct for more information.