Skip to content

[backport] Lock test_file for all_python.sh - #2466

Merged
matusmarhefka merged 1 commit into
OpenSCAP:maint-1.3from
jan-cerny:backport_2457
Oct 22, 2026
Merged

matusmarhefka merged 1 commit into
OpenSCAP:maint-1.3from
jan-cerny:backport_2457

Conversation

@jan-cerny

Copy link
Copy Markdown
Member

This PR is a backport of the PR #2457 to the maint-1.3 branch.

The tests of RESOURCE_LOCK test_file_lock create, check and remove ./test_file in the build directory of tests/API/XCCDF/unittests, so ctest runs them one at a time. test_remediate_python.sh and test_remediate_python_subs.sh, which all_python.sh runs, do the same, but all_python.sh is outside the lock. Under ctest -j a locked test can remove the file a python remediation just created, or the reverse, and one of them fails.

all_python.sh exists only when CMake finds Python, so it joins the lock in a set_tests_properties of its own under that condition.

On Fedora 44, 50 runs of ctest -j8 over the 20 locked tests and all_python.sh failed 3 times on main: test_remediate_simple.sh, which ctest starts beside all_python.sh, failed each time, and all_python.sh once too. With this change the 50 runs passed.

The tests of RESOURCE_LOCK test_file_lock create, check and remove
./test_file in the build directory of tests/API/XCCDF/unittests, so
ctest runs them one at a time. test_remediate_python.sh and
test_remediate_python_subs.sh, which all_python.sh runs, do the same,
but all_python.sh is outside the lock. Under ctest -j a locked test
can remove the file a python remediation just created, or the reverse,
and one of them fails.

all_python.sh exists only when CMake finds Python, so it joins the
lock in a set_tests_properties of its own under that condition.

On Fedora 44, 50 runs of ctest -j8 over the 20 locked tests and
all_python.sh failed 3 times on main: test_remediate_simple.sh, which
ctest starts beside all_python.sh, failed each time, and all_python.sh
once too. With this change the 50 runs passed.
@jan-cerny jan-cerny added this to the 1.3.16 milestone Oct 22, 2026
@sonarqubecloud

Copy link
Copy Markdown

@vojtapolasek vojtapolasek self-assigned this Oct 22, 2026

@vojtapolasek vojtapolasek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@matusmarhefka
matusmarhefka merged commit 46c358a into OpenSCAP:maint-1.3 Oct 22, 2026
11 checks passed
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.

4 participants