diff --git a/core/src/main/kotlin/com/malinskiy/marathon/execution/strategy/impl/flakiness/ProbabilityBasedFlakinessStrategy.kt b/core/src/main/kotlin/com/malinskiy/marathon/execution/strategy/impl/flakiness/ProbabilityBasedFlakinessStrategy.kt index c7e0d3c78..79dc115ac 100644 --- a/core/src/main/kotlin/com/malinskiy/marathon/execution/strategy/impl/flakiness/ProbabilityBasedFlakinessStrategy.kt +++ b/core/src/main/kotlin/com/malinskiy/marathon/execution/strategy/impl/flakiness/ProbabilityBasedFlakinessStrategy.kt @@ -34,8 +34,6 @@ class ProbabilityBasedFlakinessStrategy(@JsonProperty("minSuccessRate") private currentFailRate *= currentFailRate counter++ } - } else { - output.add(it) } } return testShard.copy(flakyTests = output) diff --git a/core/src/test/kotlin/com/malinskiy/marathon/execution/strategy/impl/flakiness/ProbabilityBasedFlakinessStrategySpek.kt b/core/src/test/kotlin/com/malinskiy/marathon/execution/strategy/impl/flakiness/ProbabilityBasedFlakinessStrategySpek.kt index 2f3b0235b..31b85dbad 100644 --- a/core/src/test/kotlin/com/malinskiy/marathon/execution/strategy/impl/flakiness/ProbabilityBasedFlakinessStrategySpek.kt +++ b/core/src/test/kotlin/com/malinskiy/marathon/execution/strategy/impl/flakiness/ProbabilityBasedFlakinessStrategySpek.kt @@ -23,6 +23,18 @@ class ProbabilityBasedFlakinessStrategySpek : Spek({ result.tests.size shouldBe 1 result.flakyTests.size shouldBe 2 } + it("should return zero flaky tests for one test with success rate 0.8") { + val metricsProvider = MetricsProviderStub(successRate = 0.8) + val result = strategy.process(testShard, metricsProvider) + result.tests.size shouldBe 1 + result.flakyTests.size shouldBe 0 + } + it("should return zero flaky tests for one test with success rate 1") { + val metricsProvider = MetricsProviderStub(successRate = 1.0) + val result = strategy.process(testShard, metricsProvider) + result.tests.size shouldBe 1 + result.flakyTests.size shouldBe 0 + } it("should return one flaky test for one test with success rate = 0.7") { val metricsProvider = MetricsProviderStub(successRate = 0.7) val result = strategy.process(testShard, metricsProvider)