test/docker-py: skip tests that enable autolock

Enabling autolock makes the swarm node renew its TLS certificate. When
the test's teardown force-leaves the swarm while that renewal is still
writing to /var/lib/docker/swarm/certificates, removing the swarm state
fails with "unlinkat /var/lib/docker/swarm/certificates: directory not
empty". The encrypted state stays on disk, so the next test's swarm
init fails with "Swarm is encrypted and needs to be unlocked", and
docker-py's force_leave_swarm helper hides the failed leave. On this
branch the victim is test_init_swarm_with_ca_config, which runs right
after test_init_swarm_with_autolock_managers.

Skip the two tests that enable autolock until the race is fixed.

Signed-off-by: Cory Snider <csnider@mirantis.com>
This commit is contained in:
Cory Snider committed 2026-10-26 21:42:43 -04:00
1 parent 4705017e96
commit 01958e5137
1 file changed
+8
+8
View File
@@ -24,6 +24,14 @@ if [ -n "$TEST_INTEGRATION_USE_SNAPSHOTTER" ]; then
PY_TEST_OPTIONS="$PY_TEST_OPTIONS --deselect=tests/integration/api_image_test.py::CommitTest::test_commit"
PY_TEST_OPTIONS="$PY_TEST_OPTIONS --deselect=tests/integration/api_image_test.py::CommitTest::test_commit_with_changes"
fi
# TODO re-enable once leaving a swarm no longer races the certificate renewal
# that follows enabling autolock. When the leave loses, it fails with
# "unlinkat /var/lib/docker/swarm/certificates: directory not empty", the
# encrypted swarm state is left behind, and the next test's swarm init fails
# with "Swarm is encrypted and needs to be unlocked".
PY_TEST_OPTIONS="$PY_TEST_OPTIONS --deselect=tests/integration/api_swarm_test.py::SwarmTest::test_init_swarm_with_autolock_managers"
PY_TEST_OPTIONS="$PY_TEST_OPTIONS --deselect=tests/integration/api_swarm_test.py::SwarmTest::test_rotate_manager_unlock_key"
(
bundle .integration-daemon-start