From 6ce894154553edc4e48798a73e5902bc1e23f4ea Mon Sep 17 00:00:00 2001 From: Anton Malinskiy Date: Thu, 23 Nov 2023 18:06:03 +1000 Subject: [PATCH] fix(billing): proper calculation of flakiness (#867) --- .../com/malinskiy/marathon/report/bill/BillingReporter.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/kotlin/com/malinskiy/marathon/report/bill/BillingReporter.kt b/core/src/main/kotlin/com/malinskiy/marathon/report/bill/BillingReporter.kt index d63220972..44ab165f4 100644 --- a/core/src/main/kotlin/com/malinskiy/marathon/report/bill/BillingReporter.kt +++ b/core/src/main/kotlin/com/malinskiy/marathon/report/bill/BillingReporter.kt @@ -62,7 +62,7 @@ internal class BillingReporter( usageTracker.trackEvent(Event.Devices(bills.size)) val result = executionReport.summary.pools.map { it.failed.isEmpty() }.reduceOrNull { acc, b -> acc && b } ?: true - val flakiness = executionReport.summary.pools.sumOf { it.rawDurationMillis - it.durationMillis / 1000 } + val flakiness = executionReport.summary.pools.sumOf { (it.rawDurationMillis - it.durationMillis) / 1000 } val durationSeconds = ((Instant.now().toEpochMilli() - defaultStart.toEpochMilli()) / 1000) usageTracker.trackEvent(Event.Executed(seconds = bills.sumOf { it.duration } / 1000, success = result,