Skip to content

Commit

Permalink
Merge pull request #946 from MarathonLabs/fix/flakiness-overhead
Browse files Browse the repository at this point in the history
fix(core): filter tests with missing duration from duration and rawDu…
  • Loading branch information
Malinskiy committed Jun 17, 2024
2 parents 003bdab + 71b092c commit f990013
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ data class ExecutionReport(
}.map { it.test.toTestName() }
.toSet()

val duration = tests.map { it.durationMillis() }.sum()
val duration = tests.filter { it.isTimeInfoAvailable }
.sumOf { it.durationMillis() }

val rawTests = poolTestEvents
.map { it.testResult }
Expand All @@ -72,8 +73,7 @@ data class ExecutionReport(
val rawDuration = rawTests
//Incomplete tests mess up the calculations of time since their end time is 0 and duration is, hence, years
//We filter here for unavailable time just to be safe
.filter { it.startTime != 0L && it.endTime != 0L }
.map { it.durationMillis() }.sum()
.filter { it.isTimeInfoAvailable }.sumOf { it.durationMillis() }

val retries = tests.map { result: TestResult ->
Pair(result, poolTestEvents.filter { it.testResult.test == result.test && it.testResult !== result })
Expand Down

0 comments on commit f990013

Please sign in to comment.