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 9bccb8a8f483142a9e038227c36799b741d45d18 Author: Gabor Gyimesi <[email protected]> AuthorDate: Mon Feb 7 15:23:08 2022 +0100 MINIFICPP-1737 Fix ConsumeKafka test transient failures Closes #1254 Signed-off-by: Marton Szasz <[email protected]> --- .../integration/minifi/validators/MultiFileOutputValidator.py | 9 ++++++--- docker/test/integration/steps/steps.py | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docker/test/integration/minifi/validators/MultiFileOutputValidator.py b/docker/test/integration/minifi/validators/MultiFileOutputValidator.py index 16a4e37..9d56da2 100644 --- a/docker/test/integration/minifi/validators/MultiFileOutputValidator.py +++ b/docker/test/integration/minifi/validators/MultiFileOutputValidator.py @@ -10,7 +10,7 @@ from .FileOutputValidator import FileOutputValidator class MultiFileOutputValidator(FileOutputValidator): """ - Validates the content of multiple files in the given directory, also verifying that the old files are not rewritten. + Validates the number of files created and/or the content of multiple files in the given directory, also verifying that the old files are not rewritten. """ def __init__(self, expected_file_count, expected_content=[]): @@ -56,7 +56,10 @@ class MultiFileOutputValidator(FileOutputValidator): self.file_timestamps[full_path] = os.path.getmtime(full_path) logging.info("New file added %s", full_path) - if len(self.file_timestamps) == self.expected_file_count: - return self.check_expected_content(full_dir) + if self.expected_file_count != 0 and len(self.file_timestamps) != self.expected_file_count: + return False + + if len(self.file_timestamps) >= len(self.expected_content): + return self.check_expected_content(full_dir) return False diff --git a/docker/test/integration/steps/steps.py b/docker/test/integration/steps/steps.py index 0678376..78415c1 100644 --- a/docker/test/integration/steps/steps.py +++ b/docker/test/integration/steps/steps.py @@ -561,7 +561,7 @@ def step_impl(context, content_1, content_2, duration): @then("flowfiles with these contents are placed in the monitored directory in less than {duration}: \"{contents}\"") def step_impl(context, duration, contents): contents_arr = contents.split(",") - context.test.check_for_multiple_files_generated(len(contents_arr), timeparse(duration), contents_arr) + context.test.check_for_multiple_files_generated(0, timeparse(duration), contents_arr) @then("after a wait of {duration}, at least {lower_bound:d} and at most {upper_bound:d} flowfiles are produced and placed in the monitored directory")
