-
Notifications
You must be signed in to change notification settings - Fork 52
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
Fixed Stream closed
error when generating Kover HTML report
#540
Conversation
When generating an HTML report, errors sometimes occur when reading the freemarker template from resources. The exact cause of the error has not yet been determined (relates to the Gradle isolated class loaders), but it disappears when you try to read again. In some cases, it is necessary to increase the number of repetitions, so this setting was made in Kover Gradle plugin. Fixes #510
3c10a2e
to
52da440
Compare
@Option(name = "--title", usage = "title in the HTML report", metaVar = "<html-title>") | ||
private var htmlTitle: String? = null | ||
@Option(name = "--title", usage = "title in the HTML or XML report", metaVar = "<title>") | ||
private var title: String? = null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change related to the fix in any way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without these changes, a compilation error occurs :)
@@ -69,6 +70,10 @@ internal abstract class HtmlReportAction : AbstractReportAction<HtmlReportParame | |||
val files = parameters.files.get() | |||
val filters = parameters.filters.get() | |||
|
|||
// repeat reading freemarker temple from resources if error occurred, see https://github.com/Kotlin/kotlinx-kover/issues/510 | |||
// the values are selected empirically so that the maximum report generation time is not much more than a second | |||
ReportApi.setFreemarkerRetry(7, 150) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you plan to keep the issue open and eventually add a proper fix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If, after this fix, the error will still be reproduced, then it will be necessary to understand more deeply
When generating an HTML report, errors sometimes occur when reading the freemarker template from resources. The exact cause of the error has not yet been determined (relates to the Gradle isolated class loaders), but it disappears when you try to read again. In some cases, it is necessary to increase the number of repetitions, so this setting was made in Kover Gradle plugin.
Fixes #510