Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pub/Sub unit tests are slow #1159

Closed
garrettjonesgoogle opened this issue Aug 12, 2016 · 6 comments
Closed

Pub/Sub unit tests are slow #1159

garrettjonesgoogle opened this issue Aug 12, 2016 · 6 comments
Assignees

Comments

@garrettjonesgoogle
Copy link
Member

In particular, AckDeadlineRenewerTest and LocalSystemTest take most of the time because of multiple 10 second waits that they do. The overall tests on my machine take 3:13, with 2:32 of it in Pub/Sub. Could these tests be refactored to use a fake clock?

@mziccard
Copy link
Contributor

There was a bit of a discussion on this here

@garrettjonesgoogle
Copy link
Member Author

It think it would be very helpful for development to separate out slow tests (which I would argue are more like integration tests) from the "mvn test" target, and provide a separate target for the slow tests. We might still want Travis to run the slow tests.

@mziccard
Copy link
Contributor

It think it would be very helpful

I'll consider this, but I don't see a pressing need at the moment

@garrettjonesgoogle
Copy link
Member Author

Well, I find it very, very, very annoying when I have to run tests multiple times from the command line.

@garrettjonesgoogle
Copy link
Member Author

The time it takes to run these tests probably has a multiplicative effect since there is a limit on the number of concurrent Travis builds per repository. If we speed this up we'll see much shorter queues.

@garrettjonesgoogle
Copy link
Member Author

Actually the reason that builds take so long on Travis is because we run integration tests there.

Regardless, I fixed the running time of AckDeadlineRenewerTest in 1a8a438 by using a fake Clock and a fake ScheduledExecutorService. I'll resolve this issue now.

github-actions bot pushed a commit that referenced this issue Jun 21, 2022
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 454027580

Source-Link: googleapis/googleapis@1b22277

Source-Link: https://github.com/googleapis/googleapis-gen/commit/e04cea20d0d12eb5c3bdb360a9e72b654edcb638
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTA0Y2VhMjBkMGQxMmViNWMzYmRiMzYwYTllNzJiNjU0ZWRjYjYzOCJ9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants