You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/02/19 10:15:18 UTC

[GitHub] rabbah commented on a change in pull request #3302: Sanitize test subjects before tests.

rabbah commented on a change in pull request #3302: Sanitize test subjects before tests.
URL: https://github.com/apache/incubator-openwhisk/pull/3302#discussion_r169032159
 
 

 ##########
 File path: tests/src/test/scala/limits/ThrottleTests.scala
 ##########
 @@ -298,10 +298,25 @@ class NamespaceSpecificThrottleTests
     with BeforeAndAfterAll
     with LocalHelper {
 
+  val defaultAction = Some(TestUtils.getTestActionFilename("hello.js"))
+
   val wskadmin = new RunWskAdminCmd {}
   val wsk = new WskRest
 
-  val defaultAction = Some(TestUtils.getTestActionFilename("hello.js"))
+  def sanitizeNamespaces(namespaces: Seq[String], expectedExitCode: Int = SUCCESS_EXIT) = {
+    namespaces.foreach { ns =>
+      try {
+        disposeAdditionalTestSubject(ns, expectedExitCode)
+        withClue(s"failed to delete temporary limits for $ns") {
+          wskadmin.cli(Seq("limits", "delete", ns), expectedExitCode)
 
 Review comment:
   The cli cmds shouldn?t fail with expected exit set to don?t care but could fail if set to success. The try slows other ids to be cleaned. 
   
   Are you thinking to force failure vs logging only?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services