szaszm commented on code in PR #2061:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2061#discussion_r2586025253


##########
extensions/standard-processors/tests/features/defragtextflowfiles.feature:
##########
@@ -28,18 +26,20 @@ Feature: DefragmentText can defragment fragmented data from 
TailFile
     And a file with filename "test_file_two.log" and content "<input_two>" is 
present in "/tmp/input"
     And a DefragmentText processor with the "Pattern" property set to 
"<pattern>"
     And the "Pattern Location" property of the DefragmentText processor is set 
to "<pattern location>"
+    And DefragmentText is EVENT_DRIVEN
     And a PutFile processor with the name "SuccessPut" and the "Directory" 
property set to "/tmp/output"
+    And SuccessPut is EVENT_DRIVEN
     And the "success" relationship of the MultiTail processor is connected to 
the DefragmentText
     And the "success" relationship of the DefragmentText processor is 
connected to the SuccessPut
-
+    And SuccessPut's success relationship is auto-terminated
 
     When all instances start up
-    Then flowfiles with these contents are placed in the monitored directory 
in less than 60 seconds: "<success_flow_files>"
+    Then the contents of /tmp/output in less than 60 seconds are: 
"<success_flow_files>"
 
     Examples:
       | input_one                                    | input_two               
                         | pattern       | pattern location | 
success_flow_files                                                          |
       | <1>cat%dog%mouse%<2>apple%banana%<3>English% | 
<1>Katze%Hund%Maus%<2>Apfel%Banane%<3>Deutsch%   | <[0-9]+>      | Start of 
Message | 
<1>cat%dog%mouse%,<1>Katze%Hund%Maus%,<2>apple%banana%,<2>Apfel%Banane%       |
-      | <1>cat%dog%mouse%<2>apple%banana%<3>English% | 
<1>Katze%Hund%Maus%<2>Apfel%Banane%<3>Deutsch%   | <[0-9]+>      | End of 
Message   | 
<1>,cat%dog%mouse%<2>,Katze%Hund%Maus%<2>,apple%banana%<3>,Apfel%Banane%<3>   |
+      | <1>cat%dog%mouse%<2>apple%banana%<3>English% | 
<1>Katze%Hund%Maus%<2>Apfel%Banane%<3>Deutsch%   | <[0-9]+>      | End of 
Message   | 
<1>,<1>,cat%dog%mouse%<2>,Katze%Hund%Maus%<2>,apple%banana%<3>,Apfel%Banane%<3> 
  |

Review Comment:
   What changed here?



##########
extensions/standard-processors/tests/features/steps/tcp_client_container.py:
##########
@@ -0,0 +1,40 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from minifi_test_framework.containers.container import Container
+from minifi_test_framework.core.helpers import wait_for_condition
+from minifi_test_framework.core.minifi_test_context import MinifiTestContext
+
+
+class TcpClientContainer(Container):
+    def __init__(self, test_context: MinifiTestContext):
+        cmd = (
+            "/bin/sh -c 'apk add netcat-openbsd && "
+            "echo TCP client container started; "
+            "while true; do echo test_tcp_message | "
+            f"nc minifi-primary-{test_context.scenario_id} 10254; "
+            "sleep 1; done'"
+        )

Review Comment:
   is wrapping in `sh -c` necessary? I suspect it's not, because the command is 
given as a single string, meaning it has to go through a command line 
interpreter before being executed.
   ```suggestion
           cmd = (
               "apk add netcat-openbsd && "
               "echo TCP client container started; "
               "while true; do"
               f"    echo test_tcp_message | nc 
minifi-primary-'{test_context.scenario_id}' 10254; "
               "    sleep 1;"
               "done"
           )
   ```



##########
extensions/standard-processors/tests/features/evaluate_json_path.feature:
##########
@@ -39,12 +40,16 @@ Feature: Writing JSON path query result to attribute or 
flow file using Evaluate
     And the "author" property of the EvaluateJsonPath processor is set to 
"$.author"
     And the "release" property of the EvaluateJsonPath processor is set to 
"$.release"
     And a PutFile processor with the "Directory" property set to "/tmp/output"
+    And PutFile is EVENT_DRIVEN
     And a LogAttribute processor
+    And LogAttribute is EVENT_DRIVEN
     And the "success" relationship of the GetFile processor is connected to 
the EvaluateJsonPath
     And the "matched" relationship of the EvaluateJsonPath processor is 
connected to the PutFile
     And the "success" relationship of the PutFile processor is connected to 
the LogAttribute
+    And PutFile's failure relationship is auto-terminated
+    And LogAttribute's success relationship is auto-terminated
     When the MiNiFi instance starts up
-    Then a flowfile with the JSON content "{"title": "1984", "author": null}" 
is placed in the monitored directory in less than 10 seconds
+    Then a file with the JSON content "{"title": "1984", "author": null}" is 
placed in the "/tmp/output" directory in less than 10 seconds
     And the Minifi logs contain the following message: "key:title value:1984" 
in less than 10 seconds
-    And the Minifi logs contain the following message: "key:author value:null" 
in less than 0 seconds
-    And the Minifi logs do not contain the following message: "key:release" 
after 0 seconds
+    And the Minifi logs contain the following message: "key:author value:null" 
in less than 1 seconds
+    And the Minifi logs do not contain the following message: "key:release" 
after 10 seconds

Review Comment:
   why were the timeouts changed?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to