cmd/coordinator: fix bug where try build status would never go away

If the Gerrit query reported no CLs needed trybot runs, we returned
too early and didn't clear our state. Remove that 'if len(cis) == 0'
early return. The optimization was buggy and not even worth much if
correct.

Also rename some confusing variables.

Change-Id: I485d303c36cc477e3ac651ec25b2c777f512b658
Reviewed-on: https://go-review.googlesource.com/36808
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Brad Fitzpatrick 2017-02-11 22:10:24 +00:00
Родитель f65b532dab
Коммит b6845bdb45
1 изменённых файлов: 7 добавлений и 10 удалений

Просмотреть файл

@ -96,7 +96,7 @@ var (
)
func initTryBuilders() {
tryList := []string{
names := []string{
"darwin-amd64-10_11",
"linux-386",
"linux-amd64",
@ -110,15 +110,15 @@ func initTryBuilders() {
"nacl-amd64p32",
"linux-arm",
}
for bname := range dashboard.Builders {
if strings.HasPrefix(bname, "misc-compile") {
tryList = append(tryList, bname)
for name := range dashboard.Builders {
if strings.HasPrefix(name, "misc-compile") {
names = append(names, name)
}
}
for _, bname := range tryList {
conf, ok := dashboard.Builders[bname]
for _, name := range names {
conf, ok := dashboard.Builders[name]
if !ok {
log.Printf("ignoring invalid try builder config %q", bname)
log.Printf("ignoring invalid try builder config %q", name)
continue
}
tryBuilders = append(tryBuilders, conf)
@ -819,9 +819,6 @@ func findTryWork() error {
if err != nil {
return err
}
if len(cis) == 0 {
return nil
}
statusMu.Lock()
defer statusMu.Unlock()