This is an automated email from the ASF dual-hosted git repository.
vvraskin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git
The following commit(s) were added to refs/heads/master by this push:
new db040cb Make WskRestRuleTests more stable. (#4317)
db040cb is described below
commit db040cb9cfef0a7a9228f033c61581170ef8de77
Author: Christian Bickel <[email protected]>
AuthorDate: Fri Mar 1 13:48:36 2019 +0100
Make WskRestRuleTests more stable. (#4317)
If there is an deployment with several controllers, the test `Whisk rules
should preserve rule status when a rule is updated` fails intermittently. The
reason is, that there are several modifications on the rule. These
modifications are already retried. But enabling and disabling the rule also
modifies the database document. But that change is currently not retried.
This PR puts the enabling/disabling of the rule into the retry block as
well to make this test more stable against our eventual consistency.
Co-authored-by: Somaya Jamil <[email protected]>
---
tests/src/test/scala/system/basic/WskRestRuleTests.scala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/src/test/scala/system/basic/WskRestRuleTests.scala
b/tests/src/test/scala/system/basic/WskRestRuleTests.scala
index 1223991..4cebffb 100644
--- a/tests/src/test/scala/system/basic/WskRestRuleTests.scala
+++ b/tests/src/test/scala/system/basic/WskRestRuleTests.scala
@@ -67,9 +67,9 @@ class WskRestRuleTests extends WskRuleTests with
WskActorSystem {
statusPermutations.foreach {
case (trigger, status) =>
- if (status == active) wsk.rule.enable(ruleName) else
wsk.rule.disable(ruleName)
// Needs to be retried since the enable/disable causes a cache
invalidation which needs to propagate first
retry({
+ if (status == active) wsk.rule.enable(ruleName) else
wsk.rule.disable(ruleName)
val createStdout = wsk.rule.create(ruleName, trigger, actionName,
update = true).stdout
val getStdout = wsk.rule.get(ruleName).stdout
wsk.parseJsonString(createStdout).fields.get("status") shouldBe
status