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

Send coverage on jvm shutdown event #166

Open
wants to merge 3 commits into
base: merge/v0.9.0
Choose a base branch
from

Conversation

iryabov
Copy link
Contributor

@iryabov iryabov commented Jul 2, 2024

No description provided.

@@ -54,6 +54,10 @@ class IntervalCoverageSender(

override fun stopSendingCoverage() {
scheduledThreadPool.shutdown()
if (!scheduledThreadPool.awaitTermination(5, TimeUnit.SECONDS)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume awaitTermination is required to have enough time to send coverage data.
I suggest to

        if (!scheduledThreadPool.awaitTermination(5, TimeUnit.SECONDS)) {
          logger.error("Failed to send some coverage data prior to shutdown") // signal to user that some coverage data is lost
          scheduledThreadPool.shutdownNow();
        }

If we'll get that error message a lot - we could investigate + make termination timeout configurable.

Copy link

sonarcloud bot commented Jul 2, 2024

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

Successfully merging this pull request may close these issues.

None yet

2 participants