houshengbo commented on a change in pull request #3776: Allow command runner to
retry on network exit with custom retry
URL:
https://github.com/apache/incubator-openwhisk/pull/3776#discussion_r196099132
##########
File path: tests/src/test/scala/common/Wsk.scala
##########
@@ -1070,6 +1060,16 @@ trait RunWskCmd extends BaseRunWsk {
rr
}
+
+ /** Retries cmd on network error exit. */
+ private def retry(i: Int, N: Int, cmd: () => RunResult): RunResult = {
+ val rr = cmd()
+ if (rr.exitCode == NETWORK_ERROR_EXIT && i < N) {
+ Thread.sleep(1.second.toMillis)
+ println(s"command will retry to due to network error: $rr")
Review comment:
Shall we use log this message as a warning message or info? I do not see
println is still using anywhere else except in the test cases.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services