From 144f9334f5f34fb1cbf9c1208c50b9607110e777 Mon Sep 17 00:00:00 2001 From: Anuar Beisembayev Date: Tue, 19 Nov 2024 13:20:03 -0500 Subject: [PATCH] Issue 6258 - Resolve race condition for two tests in health_config.py The following two tests in health_config.py have race conditions preventing them from working consistently: dirsrvtests/tests/suites/healthcheck/health_config_test.py::test_healthcheck_notes_unindexed_search dirsrvtests/tests/suites/healthcheck/health_config_test.py::test_healthcheck_notes_unknown_attribute These failures are mitigated by adding a sleep command shortly after the filter command to ensure it has time to complete. Helps fix: https://github.com/389ds/389-ds-base/issues/6258 --- dirsrvtests/tests/suites/healthcheck/health_config_test.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dirsrvtests/tests/suites/healthcheck/health_config_test.py b/dirsrvtests/tests/suites/healthcheck/health_config_test.py index 823f698528..e1e5398abd 100644 --- a/dirsrvtests/tests/suites/healthcheck/health_config_test.py +++ b/dirsrvtests/tests/suites/healthcheck/health_config_test.py @@ -24,6 +24,8 @@ from lib389.cli_ctl.health import health_check_run from lib389.paths import Paths +from time import sleep + pytestmark = pytest.mark.tier1 CMD_OUTPUT = 'No issues found.' @@ -378,6 +380,7 @@ def test_healthcheck_notes_unindexed_search(topology_st, setup_ldif): log.info('Use filters to reproduce "notes=A" in access log') accounts = Accounts(standalone, DEFAULT_SUFFIX) accounts.filter('(uid=test*)') + sleep(1) log.info('Check that access log contains "notes=A"') assert standalone.ds_access_log.match(r'.*notes=A.*') @@ -429,6 +432,7 @@ def test_healthcheck_notes_unknown_attribute(topology_st, setup_ldif): log.info('Use filters to reproduce "notes=F" in access log') accounts = Accounts(standalone, DEFAULT_SUFFIX) accounts.filter('(unknown=test)') + sleep(1) log.info('Check that access log contains "notes=F"') assert standalone.ds_access_log.match(r'.*notes=F.*')