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

szaszm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit 35c0e3f11a3b5ab3f2a8550fef8648e0845bcaef
Author: Martin Zink <[email protected]>
AuthorDate: Tue Sep 12 16:00:47 2023 +0200

    MINIFICPP-2195 fix flaky MQTT docker tests
    
    Closes #1652
    
    Signed-off-by: Marton Szasz <[email protected]>
---
 docker/test/integration/features/mqtt.feature   |  9 ++++-----
 docker/test/integration/features/steps/steps.py | 13 ++-----------
 2 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/docker/test/integration/features/mqtt.feature 
b/docker/test/integration/features/mqtt.feature
index 2268dd49d..17300956e 100644
--- a/docker/test/integration/features/mqtt.feature
+++ b/docker/test/integration/features/mqtt.feature
@@ -70,10 +70,10 @@ Feature: Sending data to MQTT streaming platform using 
PublishMQTT
     And the "success" relationship of the PublishMQTT processor is connected 
to the PutFile
 
     When the MiNiFi instance starts up
-    Then no files are placed in the monitored directory in 30 seconds of 
running time
+    Then no files are placed in the monitored directory in 10 seconds of 
running time
 
-    And an MQTT broker is deployed in correspondence with the PublishMQTT
-    And a flowfile with the content "test" is placed in the monitored 
directory in less than 60 seconds
+    When an MQTT broker is set up in correspondence with the PublishMQTT
+    Then a flowfile with the content "test" is placed in the monitored 
directory in less than 60 seconds
     And the MQTT broker has a log line matching "Received PUBLISH from 
.*testtopic.*\(4 bytes\)"
 
     Examples: MQTT versions
@@ -319,8 +319,7 @@ Feature: Sending data to MQTT streaming platform using 
PublishMQTT
 
     And an MQTT broker is set up in correspondence with the PublishMQTT and 
ConsumeMQTT
 
-    When the MQTT broker is started
-    And "publisher-client" flow is started
+    When both instances start up
     Then the MQTT broker has a log line matching "Received PUBLISH from 
.*testtopic.*\(4 bytes\)"
 
     # consumer is joining late, but it will still see the retained message
diff --git a/docker/test/integration/features/steps/steps.py 
b/docker/test/integration/features/steps/steps.py
index cb4094d48..161e3a3fa 100644
--- a/docker/test/integration/features/steps/steps.py
+++ b/docker/test/integration/features/steps/steps.py
@@ -423,11 +423,13 @@ def step_impl(context):
 
 
 # MQTT setup
+@when("an MQTT broker is set up in correspondence with the PublishMQTT")
 @given("an MQTT broker is set up in correspondence with the PublishMQTT")
 @given("an MQTT broker is set up in correspondence with the ConsumeMQTT")
 @given("an MQTT broker is set up in correspondence with the PublishMQTT and 
ConsumeMQTT")
 def step_impl(context):
     context.test.acquire_container(context=context, name="mqtt-broker", 
engine="mqtt-broker")
+    context.test.start('mqtt-broker')
 
 
 # s3 setup
@@ -957,17 +959,6 @@ def step_impl(context, minifi_container_name, log_pattern, 
duration):
     context.test.check_container_log_matches_regex(minifi_container_name, 
log_pattern, humanfriendly.parse_timespan(duration), count=1)
 
 
-@then("an MQTT broker is deployed in correspondence with the PublishMQTT")
-def step_impl(context):
-    context.test.acquire_container(context=context, name="mqtt-broker", 
engine="mqtt-broker")
-    context.test.start()
-
-
-@when("the MQTT broker is started")
-def step_impl(context):
-    context.test.start('mqtt-broker')
-
-
 # Google Cloud Storage
 @then('an object with the content \"{content}\" is present in the Google Cloud 
storage')
 def step_imp(context, content):

Reply via email to