[GitHub] mdeuser commented on a change in pull request #3694: Add retries to CLI test framework for network errors
mdeuser commented on a change in pull request #3694: Add retries to CLI test framework for network errors URL: https://github.com/apache/incubator-openwhisk/pull/3694#discussion_r193895451 ## File path: tests/src/test/scala/common/Wsk.scala ## @@ -1036,13 +1036,28 @@ trait RunWskCmd extends BaseRunWsk { val args = baseCommand if (verbose) args += "--verbose" if (showCmd) println(args.mkString(" ") + " " + params.mkString(" ")) -val rr = TestUtils.runCmd( - DONTCARE_EXIT, - workingDir, - TestUtils.logger, - sys.env ++ env, - stdinFile.getOrElse(null), - args ++ params: _*) +val rr = + retry( +{ + val rr = TestUtils.runCmd( +DONTCARE_EXIT, +workingDir, +TestUtils.logger, +sys.env ++ env, +stdinFile.getOrElse(null), +args ++ params: _*) + + if (expectedExitCode != NETWORK_ERROR_EXIT) { +withClue(hideStr(reportFailure(args ++ params, expectedExitCode, rr).toString(), hideFromOutput)) { Review comment: will each retry will have a `withClue` stack trace message, followed by a final `withClue` message (line 1062) if all retries fail? 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: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mdeuser commented on a change in pull request #3694: Add retries to CLI test framework for network errors
mdeuser commented on a change in pull request #3694: Add retries to CLI test framework for network errors URL: https://github.com/apache/incubator-openwhisk/pull/3694#discussion_r193823978 ## File path: tests/src/test/scala/common/Wsk.scala ## @@ -1036,13 +1036,28 @@ trait RunWskCmd extends BaseRunWsk { val args = baseCommand if (verbose) args += "--verbose" if (showCmd) println(args.mkString(" ") + " " + params.mkString(" ")) -val rr = TestUtils.runCmd( - DONTCARE_EXIT, - workingDir, - TestUtils.logger, - sys.env ++ env, - stdinFile.getOrElse(null), - args ++ params: _*) +val rr = + retry( +{ + val rr = TestUtils.runCmd( +DONTCARE_EXIT, +workingDir, +TestUtils.logger, +sys.env ++ env, +stdinFile.getOrElse(null), +args ++ params: _*) + + if (expectedExitCode != NETWORK_ERROR_EXIT) { +withClue(hideStr(reportFailure(args ++ params, expectedExitCode, rr).toString(), hideFromOutput)) { Review comment: is the `withClue` line still needed now that the `retry` is displaying the failure message? 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: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mdeuser commented on a change in pull request #3694: Add retries to CLI test framework for network errors
mdeuser commented on a change in pull request #3694: Add retries to CLI test framework for network errors URL: https://github.com/apache/incubator-openwhisk/pull/3694#discussion_r193747609 ## File path: tests/src/test/scala/common/Wsk.scala ## @@ -1036,13 +1036,26 @@ trait RunWskCmd extends BaseRunWsk { val args = baseCommand if (verbose) args += "--verbose" if (showCmd) println(args.mkString(" ") + " " + params.mkString(" ")) -val rr = TestUtils.runCmd( - DONTCARE_EXIT, - workingDir, - TestUtils.logger, - sys.env ++ env, - stdinFile.getOrElse(null), - args ++ params: _*) +val rr = + retry( +{ + val rr = TestUtils.runCmd( +DONTCARE_EXIT, +workingDir, +TestUtils.logger, +sys.env ++ env, +stdinFile.getOrElse(null), +args ++ params: _*) + + if (expectedExitCode != NETWORK_ERROR_EXIT && rr.exitCode == NETWORK_ERROR_EXIT) { +println("A network error occurred.") Review comment: maybe add a bit more context to this output line... i.e. that the cli will be retried.. maybe the retry count if available.. 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: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mdeuser commented on a change in pull request #3694: Add retries to CLI test framework for network errors
mdeuser commented on a change in pull request #3694: Add retries to CLI test framework for network errors URL: https://github.com/apache/incubator-openwhisk/pull/3694#discussion_r19132 ## File path: tests/src/test/scala/common/TestUtils.java ## @@ -54,11 +54,12 @@ public class TestUtils { protected static final Logger logger = Logger.getLogger("basic"); -public static final int SUCCESS_EXIT= 0; -public static final int ERROR_EXIT = 1; -public static final int MISUSE_EXIT = 2; -public static final int DONTCARE_EXIT = -1; // any value is ok -public static final int ANY_ERROR_EXIT = -2; // any non-zero value is ok +public static final int SUCCESS_EXIT= 0; +public static final int ERROR_EXIT = 1; +public static final int MISUSE_EXIT = 2; +public static final int DONTCARE_EXIT = -1; // any value is ok +public static final int ANY_ERROR_EXIT = -2; // any non-zero value is ok +public static final int NETWORK_ERROR_EXIT = 3; Review comment: yes, when detected. https://github.com/apache/incubator-openwhisk-client-go/blob/df32dca4aecca4ec30add11ce89eac72928f95f4/whisk/wskerror.go#L22 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: us...@infra.apache.org With regards, Apache Git Services