Skip to content

Commit

Permalink
cmd/coordinator: support skipping redundant tests on try runs
Browse files Browse the repository at this point in the history
Also, don't start obtaining test sharding buildlets early if they're
reverse buildlets. Reverse buildlets are either immediately available,
or they're not. No point monopolizing them earlier than needed.

Updates golang/go#17104

Change-Id: If5a0bbd0c59b55750adfeeaa8d0f81cdbcc8ad48
Reviewed-on: https://go-review.googlesource.com/29473
Reviewed-by: Matthew Dempsky <[email protected]>
  • Loading branch information
bradfitz committed Sep 21, 2016
1 parent 9c8f13d commit 6d82497
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion cmd/coordinator/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,7 @@ func (st *buildStatus) expectedBuildletStartDuration() time.Duration {
// ready, such that they're ready when make.bash is done. But we don't
// want to start too early, lest we waste idle resources during make.bash.
func (st *buildStatus) getHelpersReadySoon() {
if st.isSubrepo() || st.conf.NumTestHelpers(st.isTry()) == 0 {
if st.isSubrepo() || st.conf.NumTestHelpers(st.isTry()) == 0 || st.conf.IsReverse {
return
}
time.AfterFunc(st.expectedMakeBashDuration()-st.expectedBuildletStartDuration(),
Expand Down Expand Up @@ -1819,11 +1819,25 @@ func (st *buildStatus) distTestList() (names []string, remoteErr, err error) {
return
}
for _, test := range strings.Fields(buf.String()) {
if st.shouldSkipTest(test) {
continue
}
names = append(names, test)
}
return names, nil, nil
}

// shouldSkipTest reports whether this test should be skipped. We
// only do this for slow builders running redundant tests. (That is,
// tests which have identical behavior across different ports)
func (st *buildStatus) shouldSkipTest(testName string) bool {
switch testName {
case "api":
return st.isTry() && st.name != "linux-amd64"
}
return false
}

func (st *buildStatus) newTestSet(names []string) *testSet {
set := &testSet{
st: st,
Expand Down

0 comments on commit 6d82497

Please sign in to comment.