This is an automated email from the ASF dual-hosted git repository.

heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git


The following commit(s) were added to refs/heads/master by this push:
     new 8ae18e0156 add small wait on assertions about entity failures in tests
8ae18e0156 is described below

commit 8ae18e0156c87f8bd3dfb310673bb799a5e40024
Author: Alex Heneveld <[email protected]>
AuthorDate: Sat Sep 30 12:37:00 2023 +0100

    add small wait on assertions about entity failures in tests
---
 .../src/main/java/org/apache/brooklyn/core/entity/EntityAsserts.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/core/src/main/java/org/apache/brooklyn/core/entity/EntityAsserts.java 
b/core/src/main/java/org/apache/brooklyn/core/entity/EntityAsserts.java
index 7969f3d4b2..836ca17c19 100644
--- a/core/src/main/java/org/apache/brooklyn/core/entity/EntityAsserts.java
+++ b/core/src/main/java/org/apache/brooklyn/core/entity/EntityAsserts.java
@@ -34,6 +34,7 @@ import org.apache.brooklyn.api.sensor.SensorEventListener;
 import org.apache.brooklyn.config.ConfigKey;
 import org.apache.brooklyn.core.entity.lifecycle.Lifecycle;
 import org.apache.brooklyn.test.Asserts;
+import org.apache.brooklyn.util.collections.MutableMap;
 import org.apache.brooklyn.util.time.Duration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -251,8 +252,8 @@ public class EntityAsserts {
      */
     @Beta
     public static void assertEntityFailed(Entity entity) {
-        assertAttributeEquals(entity, SERVICE_UP, false);
-        assertAttributeEquals(entity, Attributes.SERVICE_STATE_ACTUAL, 
Lifecycle.ON_FIRE);
+        assertAttributeEqualsEventually(MutableMap.of("timeout", 
Duration.ONE_SECOND), entity, SERVICE_UP, false);
+        assertAttributeEqualsEventually(MutableMap.of("timeout", 
Duration.ONE_SECOND), entity, Attributes.SERVICE_STATE_ACTUAL, 
Lifecycle.ON_FIRE);
     }
 
     @SuppressWarnings("unchecked")

Reply via email to