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/05/22 06:51:47 UTC

[GitHub] markusthoemmes commented on a change in pull request #3672: Add retries in test around package list and enhance debugging inform…

markusthoemmes commented on a change in pull request #3672: Add retries in test around package list and enhance debugging inform…
URL: https://github.com/apache/incubator-openwhisk/pull/3672#discussion_r189792536
 
 

 ##########
 File path: tests/src/test/scala/whisk/core/cli/test/WskEntitlementTests.scala
 ##########
 @@ -153,27 +153,33 @@ abstract class WskEntitlementTests extends TestHelpers with WskTestHelpers with
       pkg.create(samplePackage, shared = Some(true))(wp)
     }
 
-    val packageList = wsk.pkg.list(Some(s"/$guestNamespace"))(defaultWskProps)
-    verifyPackageSharedList(packageList, guestNamespace, samplePackage)
+    retry({
+      val packageList = wsk.pkg.list(Some(s"/$guestNamespace"))(defaultWskProps)
+      verifyPackageSharedList(packageList, guestNamespace, samplePackage)
+    }, 10, Some(500.milliseconds))
   }
 
   def verifyPackageSharedList(packageList: RunResult, namespace: String, packageName: String): Unit = {
     val fullyQualifiedPackageName = s"/$namespace/$packageName"
-    packageList.stdout should include regex (fullyQualifiedPackageName + """\s+shared""")
+    withClue(s"Packagelist is: ${packageList.stdout}; Packagename is: $fullyQualifiedPackageName")(
+      packageList.stdout should include regex (fullyQualifiedPackageName + """\s+shared"""))
   }
 
   it should "not list private packages" in withAssetCleaner(guestWskProps) { (wp, assetHelper) =>
     assetHelper.withCleaner(wsk.pkg, samplePackage) { (pkg, _) =>
       pkg.create(samplePackage)(wp)
     }
 
-    val packageList = wsk.pkg.list(Some(s"/$guestNamespace"))(defaultWskProps)
-    verifyPackageNotSharedList(packageList, guestNamespace, samplePackage)
+    retry({
+      val packageList = wsk.pkg.list(Some(s"/$guestNamespace"))(defaultWskProps)
+      verifyPackageNotSharedList(packageList, guestNamespace, samplePackage)
+    }, 10, Some(500.milliseconds))
 
 Review comment:
   Could we externalize the retry values? Or even easier, provide a local retry like:
   
   ```scala
   def retry[A](block: => A) = whisk.utils.retry(block, 10, 500.milliseconds)
   ```

----------------------------------------------------------------
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