Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 6258 - Add sleep for ramdom failure in two tests #6261

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mmatsuya
Copy link

Bug Description: The following test fails frequently. In the first one, the access log is checked before it's written. In the second one, multiple threads with the same file descriptor for access log file writes the logs with out of order.

dirsrvtests/tests/suites/healthcheck/health_config_test.py::test_healthcheck_notes_unindexed_search dirsrvtests/tests/suites/paged_results/paged_results_test.py::test_multi_suffix_search

Fix Description: Adding sleep mitigates the failure.

Fixes: #6258

(cherry-picked from the commit 1bd2e6e)

Bug Description: The following test fails frequently. In the first one,
the access log is checked before it's written. In the second one,
multiple threads with the same file descriptor for access log file
writes the logs with out of order.

dirsrvtests/tests/suites/healthcheck/health_config_test.py::test_healthcheck_notes_unindexed_search
dirsrvtests/tests/suites/paged_results/paged_results_test.py::test_multi_suffix_search

Fix Description: Adding sleep mitigates the failure.

Fixes: 389ds#6258
@@ -237,6 +237,7 @@ def paged_search(conn, suffix, controls, search_flt, searchreq_attrlist, abandon
msgid = conn.search_ext(suffix, ldap.SCOPE_SUBTREE, search_flt, searchreq_attrlist, serverctrls=controls)
log.info('Getting page %d' % (pages,))
while True:
time.sleep(1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a stress test that runs pages search 1000 times:

abandon_rate = 10
page_size = 500
nbloops = 1000
search_flt = r'(uid=*)'
searchreq_attrlist = ['dn', 'sn']
log.info('Set user bind %s ' % create_user)
conn = create_user.bind(TEST_USER_PWD)
for idx in range(nbloops):
req_ctrl = SimplePagedResultsControl(True, size=page_size, cookie='')
# If the issue #5984 is not fixed the server crashs and the paged search fails with ldap.SERVER_DOWN exception
paged_search(conn, create_40k_users.suffix, [req_ctrl], search_flt, searchreq_attrlist, abandon_rate=abandon_rate)

Usually it takes about 300 seconds to complete, but with this change it takes significantly larger amount of time. I don't think we should do it here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that the sleep time can be shorter.
In my test, it worked even with time.sleep(.1) for rhel9.2 and rhel9.5. It may depend on the test environment, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Random failure in test_healthcheck_notes_unindexed_search and test_multi_suffix_search
2 participants