@@ -66,8 +66,8 @@ trait RunCliCmd extends Matchers {
66
66
stdinFile : Option [File ] = None ,
67
67
showCmd : Boolean = false ,
68
68
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" )
71
71
72
72
val args = baseCommand
73
73
if (verbose) args += " --verbose"
@@ -79,7 +79,7 @@ trait RunCliCmd extends Matchers {
79
79
if (showCmd) println(args.mkString(" " ))
80
80
81
81
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))
83
83
84
84
withClue(hideStr(reportFailure(args, expectedExitCode, rr).toString(), hideFromOutput)) {
85
85
if (expectedExitCode != TestUtils .DONTCARE_EXIT ) {
@@ -96,7 +96,7 @@ trait RunCliCmd extends Matchers {
96
96
/** Retries cmd on network error exit. */
97
97
private def retry (i : Int , N : Int , cmd : () => RunResult ): RunResult = {
98
98
val rr = cmd()
99
- if (rr.exitCode == NETWORK_ERROR_EXIT && i < N ) {
99
+ if (rr.exitCode != SUCCESS_EXIT && i < N ) {
100
100
Thread .sleep(1 .second.toMillis)
101
101
println(s " command will retry to due to network error: $rr" )
102
102
retry(i + 1 , N , cmd)
0 commit comments