Atlas › Test

skips_skipped_runs

Exact test identity: go.temporal.io/server/tools/flakereport/TestSelectTopFlakyTests/skips_skipped_runs

Package
go.temporal.io/server/tools/flakereport
Suite / test hierarchy
TestSelectTopFlakyTests/skips_skipped_runs
Test
skips_skipped_runs
Introduced at
bisect.go ×1 Frontier kind: Joint frontier
Covered ranges
7
Covered lines
22
Covered files
1

Covered source

Expand a file to inspect source; the > gutter marks covered lines.

go.temporal.io/server/tools/flakereport/bisect.go 22 covered LOC · 7 ranges

Open complete file

352 // selectTopFlakyTests selects the top-N flakiest tests that meet minimum signal thresholds.
353 // allRuns is the full set of test runs. Returns normalized test names sorted by failure rate desc.
354 > func selectTopFlakyTests(allRuns []TestRun, cfg BisectConfig) []string { bisect.go
355 > type testStats struct {
356 > fails int
357 > total int
358 > }
359 > stats := make(map[string]*testStats)
360 > for _, run := range allRuns {
361 > if run.Skipped {
362 > continue bisect.go
363 }
364 name := normalizeTestName(run.Name)
372 }
373
374 > type ranked struct { bisect.go
375 > name string
376 > rate float64
377 > fails int
378 > }
379 > var candidates []ranked
380 > for name, s := range stats {
381 if s.fails < cfg.MinFailures || s.total < cfg.MinRuns {
382 continue
389 }
390
391 > sort.Slice(candidates, func(i, j int) bool { bisect.go
392 if candidates[i].rate != candidates[j].rate {
393 return candidates[i].rate > candidates[j].rate
396 })
397
398 > n := len(candidates) bisect.go
399 > if cfg.TopN > 0 && cfg.TopN < n {
400 n = cfg.TopN
401 }
402
403 > names := make([]string, n) bisect.go
404 > for i := range names {
405 names[i] = candidates[i].name
406 }
407 > return names bisect.go
408 }
409