@@ -66,8 +66,8 @@ trait RunCliCmd extends Matchers {
6666 stdinFile : Option [File ] = None ,
6767 showCmd : Boolean = false ,
6868 hideFromOutput : Seq [String ] = Seq .empty,
69- retriesOnNetworkError : Int = 3 ): RunResult = {
70- require(retriesOnNetworkError >= 0 , " retry count on network error must not be negative" )
69+ retriesOnError : Int = 3 ): RunResult = {
70+ require(retriesOnError >= 0 , " retry count on network error must not be negative" )
7171
7272 val args = baseCommand
7373 if (verbose) args += " --verbose"
@@ -79,7 +79,7 @@ trait RunCliCmd extends Matchers {
7979 if (showCmd) println(args.mkString(" " ))
8080
8181 val rr =
82- retry(0 , retriesOnNetworkError , () => runCmd(DONTCARE_EXIT , workingDir, sys.env ++ env, stdinFile, args.toSeq))
82+ retry(0 , retriesOnError , () => runCmd(DONTCARE_EXIT , workingDir, sys.env ++ env, stdinFile, args.toSeq))
8383
8484 withClue(hideStr(reportFailure(args, expectedExitCode, rr).toString(), hideFromOutput)) {
8585 if (expectedExitCode != TestUtils .DONTCARE_EXIT ) {
@@ -96,7 +96,7 @@ trait RunCliCmd extends Matchers {
9696 /** Retries cmd on network error exit. */
9797 private def retry (i : Int , N : Int , cmd : () => RunResult ): RunResult = {
9898 val rr = cmd()
99- if (rr.exitCode == NETWORK_ERROR_EXIT && i < N ) {
99+ if (rr.exitCode != SUCCESS_EXIT && i < N ) {
100100 Thread .sleep(1 .second.toMillis)
101101 println(s " command will retry to due to network error: $rr" )
102102 retry(i + 1 , N , cmd)
0 commit comments