Filtering: Fix case when no values set for max filtered values
BUG=None
TEST=local
Change-Id: Ib6f039177609f5caa82dc5bf54aaa17d85de9fe3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/4756311
Tested-by: Derek Beckett <[email protected]>
Reviewed-by: Jesse McGuire <[email protected]>
Commit-Queue: Derek Beckett <[email protected]>
diff --git a/src/chromiumos/test/pre_process/cmd/pre-process/policies/passratepolicy.go b/src/chromiumos/test/pre_process/cmd/pre-process/policies/passratepolicy.go
index 3e67960..cbe8f90 100644
--- a/src/chromiumos/test/pre_process/cmd/pre-process/policies/passratepolicy.go
+++ b/src/chromiumos/test/pre_process/cmd/pre-process/policies/passratepolicy.go
@@ -121,7 +121,6 @@
log.Printf("testname %s < required PassRate %v with %v: IS UNSTABLE BUT ALLOWED DUE TO MAX FILTER # REACHED.\n", testname, q.requiredPassRate, passRate)
return true, filterRemaining
}
- log.Printf("testname %s < required PassRate %v with %v: MARKED UNSTABLE (might still run due to overrides).\n", testname, q.requiredPassRate, passRate)
filterRemaining--
return false, filterRemaining
@@ -163,7 +162,13 @@
func maxAllowedToBeFiltered(req *api.PassRatePolicy, totalTests int) int {
maxI := req.MaxFilteredInt
+ if maxI == 0 {
+ maxI = math.MaxInt32
+ }
maxP := req.MaxFilteredPercent
+ if maxP == 0 {
+ maxP = 100
+ }
percentAsInt := math.Round(float64(totalTests * int(maxP) / 100))
return int(math.Min(float64(maxI), percentAsInt))
}
@@ -196,6 +201,11 @@
continue
}
+ if !signal {
+ log.Printf("testname %s < required PassRate %v with %v: MARKED UNSTABLE (might still run due to overrides).\n", resp.Normalized_test, q.requiredPassRate, resp.Success_permille)
+
+ }
+
fmted := structs.SignalFormat{
Runs: resp.Total_runs,
Failruns: resp.Fail_runs,