Issue 6258 - Mitigate race condition in paged_results_test.py#6433
Issue 6258 - Mitigate race condition in paged_results_test.py#6433progier389 merged 1 commit into389ds:mainfrom
Conversation
dadec79 to
f7c7fa8
Compare
|
Amended commit to move a helper function inside the test function for readability. |
progier389
left a comment
There was a problem hiding this comment.
LGTM
FYI: rather than using indexes to extract the string you can also use directly the regular expression module. Here is an use example:
import re
str="xxxx op=123 conn=567 RESULT xxx"
result = re.search(r'(op=\d+ conn=\d+)', str)
print(result.group(1))
|
I agree with @progier389, this should be a regex. |
f7c7fa8 to
e901e1b
Compare
|
Amended commit to correct the error in the message and replace the string index function with the simpler regex solution. Full test runtime for paged_results_test.py comes in at 6 minutes 46 seconds. |
|
Looks good. |
e901e1b to
a5cc7f2
Compare
|
Added missing re import. |
|
|
||
| access_log_lines = topology_st.standalone.ds_access_log.match('.*pr_cookie=.*') | ||
| # Sort access_log_lines by op number to mitigate race condition effects. | ||
| access_log_lines.sort(key=lambda x: int(re.search(r"op=(.*?) RESULT", x).group(1))) |
There was a problem hiding this comment.
Minor nitpick, but I think we should be as specific as possible to avoid any weird issues:
| access_log_lines.sort(key=lambda x: int(re.search(r"op=(.*?) RESULT", x).group(1))) | |
| access_log_lines.sort(key=lambda x: int(re.search(r"op=(\d+) RESULT", x).group(1))) |
There was a problem hiding this comment.
Good catch! The commit is amended now with that change.
There was a problem hiding this comment.
Full test runtime comes in at 7 minutes 2 seconds.
The regression test dirsrvtests/tests/suites/paged_results/paged_results_test.py::test_multi_suffix_search has a race condition causing it to fail due to multiple queries potentially writing their logs out of chronological order. This failure is mitigated by sorting the retrieved access_log_lines by their "op" value. This ensures the log lines are in chronological order, as expected by the assertions at the end of test_multi_suffix_search(). Fixes: 389ds#6258
a5cc7f2 to
2848e3e
Compare
…6433) The regression test dirsrvtests/tests/suites/paged_results/paged_results_test.py::test_multi_suffix_search has a race condition causing it to fail due to multiple queries potentially writing their logs out of chronological order. This failure is mitigated by sorting the retrieved access_log_lines by their "op" value. This ensures the log lines are in chronological order, as expected by the assertions at the end of test_multi_suffix_search(). Helps fix: 389ds#6258 Reviewed by: @droideck , @progier389 (Thanks!)
…6433) The regression test dirsrvtests/tests/suites/paged_results/paged_results_test.py::test_multi_suffix_search has a race condition causing it to fail due to multiple queries potentially writing their logs out of chronological order. This failure is mitigated by sorting the retrieved access_log_lines by their "op" value. This ensures the log lines are in chronological order, as expected by the assertions at the end of test_multi_suffix_search(). Helps fix: 389ds#6258 Reviewed by: @droideck , @progier389 (Thanks!)
…6433) The regression test dirsrvtests/tests/suites/paged_results/paged_results_test.py::test_multi_suffix_search has a race condition causing it to fail due to multiple queries potentially writing their logs out of chronological order. This failure is mitigated by sorting the retrieved access_log_lines by their "op" value. This ensures the log lines are in chronological order, as expected by the assertions at the end of test_multi_suffix_search(). Helps fix: 389ds#6258 Reviewed by: @droideck , @progier389 (Thanks!)
…6433) The regression test dirsrvtests/tests/suites/paged_results/paged_results_test.py::test_multi_suffix_search has a race condition causing it to fail due to multiple queries potentially writing their logs out of chronological order. This failure is mitigated by sorting the retrieved access_log_lines by their "op" value. This ensures the log lines are in chronological order, as expected by the assertions at the end of test_multi_suffix_search(). Helps fix: 389ds#6258 Reviewed by: @droideck , @progier389 (Thanks!)
…6433) The regression test dirsrvtests/tests/suites/paged_results/paged_results_test.py::test_multi_suffix_search has a race condition causing it to fail due to multiple queries potentially writing their logs out of chronological order. This failure is mitigated by sorting the retrieved access_log_lines by their "op" value. This ensures the log lines are in chronological order, as expected by the assertions at the end of test_multi_suffix_search(). Helps fix: 389ds#6258 Reviewed by: @droideck , @progier389 (Thanks!)
…6433) The regression test dirsrvtests/tests/suites/paged_results/paged_results_test.py::test_multi_suffix_search has a race condition causing it to fail due to multiple queries potentially writing their logs out of chronological order. This failure is mitigated by sorting the retrieved access_log_lines by their "op" value. This ensures the log lines are in chronological order, as expected by the assertions at the end of test_multi_suffix_search(). Helps fix: 389ds#6258 Reviewed by: @droideck , @progier389 (Thanks!)
The regression test dirsrvtests/tests/suites/paged_results/paged_results_test.py::test_multi_suffix_search has a race condition causing it to fail due to multiple queries potentially writing their logs out of chronological order. This failure is mitigated by sorting the retrieved access_log_lines by their "op" value. This ensures the log lines are in chronological order, as expected by the assertions at the end of test_multi_suffix_search(). Helps fix: #6258 Reviewed by: @droideck , @progier389 (Thanks!) Co-authored-by: Anuar Beisembayev <111912342+abeisemb@users.noreply.github.com>
The regression test dirsrvtests/tests/suites/paged_results/paged_results_test.py::test_multi_suffix_search has a race condition causing it to fail due to multiple queries potentially writing their logs out of chronological order. This failure is mitigated by sorting the retrieved access_log_lines by their "op" value. This ensures the log lines are in chronological order, as expected by the assertions at the end of test_multi_suffix_search(). Helps fix: #6258 Reviewed by: @droideck , @progier389 (Thanks!) Co-authored-by: Anuar Beisembayev <111912342+abeisemb@users.noreply.github.com>
The regression test dirsrvtests/tests/suites/paged_results/paged_results_test.py::test_multi_suffix_search has a race condition causing it to fail due to multiple queries potentially writing their logs out of chronological order. This failure is mitigated by sorting the retrieved access_log_lines by their "op" value. This ensures the log lines are in chronological order, as expected by the assertions at the end of test_multi_suffix_search(). Helps fix: #6258 Reviewed by: @droideck , @progier389 (Thanks!) Co-authored-by: Anuar Beisembayev <111912342+abeisemb@users.noreply.github.com>
The regression test dirsrvtests/tests/suites/paged_results/paged_results_test.py::test_multi_suffix_search has a race condition causing it to fail due to multiple queries potentially writing their logs out of chronological order. This failure is mitigated by sorting the retrieved access_log_lines by their "op" value. This ensures the log lines are in chronological order, as expected by the assertions at the end of test_multi_suffix_search(). Helps fix: #6258 Reviewed by: @droideck , @progier389 (Thanks!) Co-authored-by: Anuar Beisembayev <111912342+abeisemb@users.noreply.github.com>
The regression test dirsrvtests/tests/suites/paged_results/paged_results_test.py::test_multi_suffix_search has a race condition causing it to fail due to multiple queries potentially writing their logs out of chronological order. This failure is mitigated by sorting the retrieved access_log_lines by their "op" value. This ensures the log lines are in chronological order, as expected by the assertions at the end of test_multi_suffix_search(). Helps fix: #6258 Reviewed by: @droideck , @progier389 (Thanks!) Co-authored-by: Anuar Beisembayev <111912342+abeisemb@users.noreply.github.com>
The regression test dirsrvtests/tests/suites/paged_results/paged_results_test.py::test_multi_suffix_search has a race condition causing it to fail due to multiple queries potentially writing their logs out of chronological order. This failure is mitigated by sorting the retrieved access_log_lines by their "op" value. This ensures the log lines are in chronological order, as expected by the assertions at the end of test_multi_suffix_search(). Helps fix: #6258 Reviewed by: @droideck , @progier389 (Thanks!) Co-authored-by: Anuar Beisembayev <111912342+abeisemb@users.noreply.github.com>
The regression test dirsrvtests/tests/suites/paged_results/paged_results_test.py::test_multi_suffix_search has a race condition causing it to fail due to multiple queries potentially writing their logs out of chronological order.
This failure is mitigated by sorting the retrieved access_log_lines by their "op" value. This ensures the log lines are in chronological order, as expected by the assertions at the end of test_multi_suffix_search().
Helps fix: #6258
Reviewed by: @droideck , @progier389 (Thanks!)