Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Test reliability improvements

Rich Turner98b5b6bb3fbe
diff --git a/test/src/test/groovy/org/openremote/test/protocol/TimerProtocolTest.groovy b/test/src/test/groovy/org/openremote/test/protocol/TimerProtocolTest.groovy
index 5407cf175..7415d27a9 100644
--- a/test/src/test/groovy/org/openremote/test/protocol/TimerProtocolTest.groovy
+++ b/test/src/test/groovy/org/openremote/test/protocol/TimerProtocolTest.groovy
@@ -26,7 +26,7 @@ class TimerProtocolTest extends Specification implements ManagerContainerTrait {
def "Check timer protocol agent and device asset deployment"() {
given: "expected conditions"
- def conditions = new PollingConditions(timeout: 20, initialDelay: 0)
+ def conditions = new PollingConditions(timeout: 10, initialDelay: 0)
when: "the container starts"
def serverPort = findEphemeralPort()
@@ -40,6 +40,7 @@ class TimerProtocolTest extends Specification implements ManagerContainerTrait {
then: "the container should be running and attributes linked"
conditions.eventually {
+ assert isContainerRunning()
assert noEventProcessedIn(assetProcessingService, 500)
apartment1 = assetStorageService.find(managerDemoSetup.apartment1Id, true)
@@ -71,6 +72,11 @@ class TimerProtocolTest extends Specification implements ManagerContainerTrait {
assert cronTrigger.cronExpression == "0 30 8 ? * FRI *"
}
+ and: "all protocol linked attributes should be linked"
+ conditions.eventually {
+ assert timerProtocol.linkedAttributes.size() == 56
+ }
+
when: "a trigger is disabled"
def disableScene = new AttributeEvent(managerDemoSetup.apartment1Id, "awaySceneEnabledFRIDAY", Values.create(false))
assetProcessingService.sendAttributeEvent(disableScene)
@@ -85,6 +91,11 @@ class TimerProtocolTest extends Specification implements ManagerContainerTrait {
assert jobDetail == null
assert triggers.isEmpty()
}
+
+ and: "all protocol linked attributes should be re-linked"
+ conditions.eventually {
+ assert timerProtocol.linkedAttributes.size() == 56
+ }
when: "the trigger is re-enabled"
def enableScene = new AttributeEvent(managerDemoSetup.apartment1Id, "awaySceneEnabledFRIDAY", Values.create(true))
diff --git a/test/src/test/groovy/org/openremote/test/rules/apartment/ApartmentVacationModeTest.groovy b/test/src/test/groovy/org/openremote/test/rules/apartment/ApartmentVacationModeTest.groovy
index 60863387b..3b2202d85 100644
--- a/test/src/test/groovy/org/openremote/test/rules/apartment/ApartmentVacationModeTest.groovy
+++ b/test/src/test/groovy/org/openremote/test/rules/apartment/ApartmentVacationModeTest.groovy
@@ -28,7 +28,7 @@ class ApartmentVacationModeTest extends Specification implements ManagerContaine
def "Start and end vacation mode"() {
given: "the container environment is started"
- def conditions = new PollingConditions(timeout: 15, delay: 1)
+ def conditions = new PollingConditions(timeout: 20, delay: 1)
def serverPort = findEphemeralPort()
def container = startContainerWithPseudoClock(defaultConfig(serverPort) << [(SETUP_IMPORT_DEMO_SCENES): "true"], defaultServices())
def managerDemoSetup = container.getService(SetupService.class).getTaskOfType(ManagerDemoSetup.class)