From 700e7e4107b0aec669ce13dfa9fcb3459fbd855c Mon Sep 17 00:00:00 2001 From: Mauro Ezequiel Moltrasio Date: Fri, 10 Apr 2026 16:27:42 +0200 Subject: [PATCH] fix: mitigate flaky tests on path reloading Reloading the paths now triggers a scan of the filesystem, which can take slightly longer than what it used to take when the scan wasn't done. In order to mitigate this, we bump the amount of time the tests wait before attempting to trigger events after reloading configuration with monitored paths being changed. --- tests/test_config_hotreload.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_config_hotreload.py b/tests/test_config_hotreload.py index 20942fde..6acd71e2 100644 --- a/tests/test_config_hotreload.py +++ b/tests/test_config_hotreload.py @@ -164,7 +164,7 @@ def test_no_paths_then_add(fact, fact_config, monitored_dir, server): # Remove all paths config, config_file = fact_config config['paths'] = [] - reload_config(fact, config, config_file) + reload_config(fact, config, config_file, 1) # Write to a file — should NOT produce events fut = os.path.join(monitored_dir, 'test2.txt') @@ -180,7 +180,7 @@ def test_no_paths_then_add(fact, fact_config, monitored_dir, server): # Add paths back config['paths'] = [f'{monitored_dir}/**/*'] - reload_config(fact, config, config_file) + reload_config(fact, config, config_file, 1) # Write to a file — should produce events with open(fut, 'w') as f: @@ -209,7 +209,7 @@ def test_paths_then_remove(fact, fact_config, monitored_dir, server): # Remove all paths config, config_file = fact_config config['paths'] = [] - reload_config(fact, config, config_file) + reload_config(fact, config, config_file, 1) # Write to a file — should NOT produce events with open(fut, 'w') as f: