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

PublisherImplTest is timing out #1861

Open
hannahrogers-google opened this issue Jan 12, 2024 · 1 comment · May be fixed by #2025
Open

PublisherImplTest is timing out #1861

hannahrogers-google opened this issue Jan 12, 2024 · 1 comment · May be fixed by #2025
Assignees
Labels
api: pubsub Issues related to the googleapis/java-pubsub API. priority: p3 Desirable enhancement or fix. May not be included in next release.

Comments

@hannahrogers-google
Copy link
Contributor

I have temporarily disabled these tests causing the timeouts (testResumePublish and testPublishThrowExceptionForUnsubmittedOrderingKeyMessage), but we should investigate these failures and re-enable these tests once we have root caused the issue.

@product-auto-label product-auto-label bot added the api: pubsub Issues related to the googleapis/java-pubsub API. label Jan 12, 2024
@michaelpri10
Copy link
Contributor

Running the PublisherImplTest with these tests re-enabled is passing but I do see occasional issues where the runtime of the test is >500 seconds when doing mvn clean install or mvn clean -Dtest=com.google.cloud.pubsub.v1.PublisherImplTest test, although it still passes.

Only re-enabling testResumePublish keeps the runtime to ~12 seconds as well, but the longer time occurs when only testPublishThrowExceptionForUnsubmittedOrderingKeyMessage is re-enabled.

The delay threshold for the Publisher batching settings is 500 seconds and reducing this causes the tests to pass faster.

We expect that when the 4th message is published, we should pass this check and set the result for the message immediately, however from adding some extra logging, the error is not always set on the sequential executor in time.

Adding an fakeExecutor.advanceTime(Duration.ZERO) call to force scheduled work to be executed fixes this issue and causes the aforementioned check to pass. My testing consisted of running the test 10 times, without this added line, I saw this error occur 4/10 times, but with this line it did not occur at all. I will upload a PR with this fix.

@michaelpri10 michaelpri10 added the priority: p3 Desirable enhancement or fix. May not be included in next release. label Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the googleapis/java-pubsub API. priority: p3 Desirable enhancement or fix. May not be included in next release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants