dashboard: try to speed up pre-submit longtest builders

The longtest builders are currently primarily post-submit builders,
where it's okay for them to be as slow as they need to be in order
to provide additional test coverage. In this context, whether they
take 40 minutes or 50 makes little difference.

The longtest builders are also sometimes requested via SlowBots for
changes that are riskier than usual, or otherwise desire additional
coverage beyond the normal TryBots. They're also always enabled for
CLs to release branches. In such contexts, speeding up SlowBot runs
from 40 minutes to 20 or less would be appreciated and in turn help
people use longtest SlowBots more frequently.

Longtest builders are already configured to use sharded tests.
Configure them to use additional helpers to speed up test execution.
Try out 3, 5, and 9 helpers to see how much it helps before settling.

For golang/go#37439.

Change-Id: I425bc0257b7a54bb32c0eb1719fea7ba3f4fd461
Reviewed-on: https://go-review.googlesource.com/c/build/+/268037
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
diff --git a/dashboard/builders.go b/dashboard/builders.go
index aae71b3..4ce2cbf 100644
--- a/dashboard/builders.go
+++ b/dashboard/builders.go
@@ -841,10 +841,10 @@
 
 	// numTestHelpers is the number of _additional_ buildlets
 	// past the first one to help out with sharded tests.
-	// For trybots, the numTryHelpers value is used, unless it's
-	// zero, in which case numTestHelpers is used.
+	// For TryBots and SlowBots, the numTryHelpers value is used,
+	// unless it's zero, in which case numTestHelpers is used.
 	numTestHelpers    int
-	numTryTestHelpers int // for trybots. if 0, numTesthelpers is used
+	numTryTestHelpers int // For TryBots/SlowBots. If 0, numTestHelpers is used.
 
 	env           []string // extra environment ("key=value") pairs
 	allScriptArgs []string
@@ -1373,6 +1373,11 @@
 	return n
 }
 
+// NumTestHelpers reports how many additional buildlets
+// past the first one to help out with sharded tests.
+//
+// isTry specifies whether it's for a pre-submit test
+// run (a TryBot or SlowBot) where speed matters more.
 func (c *BuildConfig) NumTestHelpers(isTry bool) int {
 	if isTry && c.numTryTestHelpers != 0 {
 		return c.numTryTestHelpers
@@ -1754,6 +1759,10 @@
 		env: []string{
 			"GO_TEST_TIMEOUT_SCALE=5", // give them lots of time
 		},
+		// TODO(golang.org/issue/37439): Decide whether it's worth it
+		// to go for 3~9 extra helpers for -longtest SlowBot requests
+		// based on how well having more helpers scales. Try 3, 5, 9.
+		numTryTestHelpers: 9,
 	})
 	addBuilder(BuildConfig{
 		Name:     "linux-386-longtest",
@@ -1777,6 +1786,10 @@
 			"GOHOSTARCH=386",
 			"GO_TEST_TIMEOUT_SCALE=5", // give them lots of time
 		},
+		// TODO(golang.org/issue/37439): Decide whether it's worth it
+		// to go for 3~9 extra helpers for -longtest SlowBot requests
+		// based on how well having more helpers scales. Try 3, 5, 9.
+		numTryTestHelpers: 5,
 	})
 	addBuilder(BuildConfig{
 		Name:     "linux-arm",
@@ -2095,6 +2108,10 @@
 		env: []string{
 			"GO_TEST_TIMEOUT_SCALE=5", // give them lots of time
 		},
+		// TODO(golang.org/issue/37439): Decide whether it's worth it
+		// to go for 3~9 extra helpers for -longtest SlowBot requests
+		// based on how well having more helpers scales. Try 3, 5, 9.
+		numTryTestHelpers: 3,
 	})
 	addBuilder(BuildConfig{
 		Name:     "windows-amd64-race",