Skip to content

Commit

Permalink
Added a sleep in the check_mtime case of test_file_checkers to avoid …
Browse files Browse the repository at this point in the history
…a false negative
  • Loading branch information
jotacarma90 committed Jan 18, 2024
1 parent 598e874 commit 55d4928
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
from wazuh_testing.tools.monitoring import FileMonitor
from wazuh_testing.modules.fim.utils import regular_file_cud
from wazuh_testing.tools import PREFIX
from time import sleep

# Marks

Expand Down Expand Up @@ -207,6 +208,14 @@ def test_checkers(file_path, file_attrs, tags_to_apply, triggers_modification, c
'''
check_apply_test(tags_to_apply, get_configuration['tags'])

def waitasecond(event):
sleep(1)

# Test files checks.
regular_file_cud(file_path, wazuh_log_monitor, min_timeout=global_parameters.default_timeout,
options=file_attrs, triggers_modified_event=triggers_modification, escaped=True)
if file_attrs == {CHECK_MTIME}:
regular_file_cud(file_path, wazuh_log_monitor, min_timeout=global_parameters.default_timeout,
validators_after_create=[waitasecond],
options=file_attrs, triggers_modified_event=triggers_modification, escaped=True)
else:
regular_file_cud(file_path, wazuh_log_monitor, min_timeout=global_parameters.default_timeout,
options=file_attrs, triggers_modified_event=triggers_modification, escaped=True)

0 comments on commit 55d4928

Please sign in to comment.