Просмотр исходного кода

cmd/testwrapper: fix off-by-one error in maxAttempts check

It was checking if `>= maxAttempts` which meant that the third
attempt would never run.

Updates #8493

Signed-off-by: Maisem Ali <[email protected]>
Maisem Ali 2 лет назад
Родитель
Сommit
ff7f4b4224
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      cmd/testwrapper/testwrapper.go

+ 1 - 1
cmd/testwrapper/testwrapper.go

@@ -232,7 +232,7 @@ func main() {
 		var thisRun *nextRun
 		var thisRun *nextRun
 		thisRun, toRun = toRun[0], toRun[1:]
 		thisRun, toRun = toRun[0], toRun[1:]
 
 
-		if thisRun.attempt >= maxAttempts {
+		if thisRun.attempt > maxAttempts {
 			fmt.Println("max attempts reached")
 			fmt.Println("max attempts reached")
 			os.Exit(1)
 			os.Exit(1)
 		}
 		}