[tools][cts] Minor improvements to the CTS command
• Always do at least 2 passes of a roll. This will clean up any expectations, and will ensure that printed diagnostics on diffs actually make sense
• Start at 1 for `Top 25 slowest tests`
• Fix the description of cts `update-testlist` subcommand
Change-Id: I02c3c1258b5e8cd427a0d8be76676731a3fae37c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/173981
Reviewed-by: Austin Eng <enga@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
diff --git a/tools/src/cmd/cts/roll/roll.go b/tools/src/cmd/cts/roll/roll.go
index 7b77bc4..8fb72fa 100644
--- a/tools/src/cmd/cts/roll/roll.go
+++ b/tools/src/cmd/cts/roll/roll.go
@@ -384,11 +384,7 @@
// Begin main roll loop
for attempt := 0; ; attempt++ {
// Kick builds
- if attempt == 0 {
- log.Println("building...")
- } else {
- log.Printf("building (retry %v)...\n", attempt)
- }
+ log.Printf("building (pass %v)...\n", attempt+1)
builds, err := common.GetOrStartBuildsAndWait(ctx, r.cfg, ps, r.bb, r.parentSwarmingRunID, false)
if err != nil {
return err
@@ -413,10 +409,13 @@
return err
}
+ // If all the builds attempted, and we updated the expectations at least once, then we're done!
+ if attempt > 0 && len(failingBuilds) == 0 {
+ break
+ }
+
// Rebuild the expectations with the accumulated results
log.Println("building new expectations...")
- // Note: The new expectations are not used if the last attempt didn't
- // fail, but we always want to post the diagnostics
for _, exInfo := range exInfos {
// Merge the new results into the accumulated results
log.Printf("merging results for %s ...\n", exInfo.executionMode)
@@ -435,11 +434,6 @@
}
}
- // If all the builds attempted, then we're done!
- if len(failingBuilds) == 0 {
- break
- }
-
// Otherwise, push the updated expectations, and try again
log.Println("updating expectations...")
@@ -655,7 +649,7 @@
}
sb.WriteString("```\n")
for i, r := range topN {
- fmt.Fprintf(sb, "%3.1d: %v\n", i, r)
+ fmt.Fprintf(sb, "%3.1d: %v\n", i+1, r)
}
sb.WriteString("```\n")
}
diff --git a/tools/src/cmd/cts/update/testlist/testlist.go b/tools/src/cmd/cts/update/testlist/testlist.go
index 395b133..084e7ec 100644
--- a/tools/src/cmd/cts/update/testlist/testlist.go
+++ b/tools/src/cmd/cts/update/testlist/testlist.go
@@ -65,7 +65,7 @@
}
func (cmd) Desc() string {
- return "updates a CTS expectations file"
+ return "updates a CTS test list file"
}
func (c *cmd) RegisterFlags(ctx context.Context, cfg common.Config) ([]string, error) {