Skip to content

pubsub: unit tests cause emulator to use excessive CPU #697

@cortesi

Description

@cortesi

The pubsub emulator recently started using large amounts of CPU on OSX during our unit tests (other platforms untested). High CPU usage persists after the test suite has completed and all clients disconnected, until the process is restarted. I am able to reproduce this behaviour with simple clients and with google-cloud-go's own test suite.

Steps to reproduce:

  • Start the emulator:
    gcloud beta emulators pubsub start --host-port=localhost:8822
  • In the directory cloud.google.com/go/pubsub, run the test suite:
    env PUBSUB_EMULATOR_HOST=localhost:8822 go test -v

On my system, the pubsub emulator Java process CPU usage is at 45% after one run, 145% after the second run, and so forth.

This is undoubtedly a bug in the emulator, but git bisect shows that google-cloud-go only started triggering the issue with commit 927c812. This commit is included in the v0.10.0 release.

Software versions used:

  • google-cloud-go master
  • pubsub-emulator 2017.03.24
  • OSX 10.12.5

Metadata

Metadata

Assignees

Labels

api: pubsubIssues related to the Pub/Sub API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions