From aa999998eded49919086be7fc4448f5dc9eac689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Fri, 12 Jun 2026 15:20:43 +0200 Subject: [PATCH] integration/swarm: Preserve rotated unlock key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes flaky SwarmTest.test_update_node erroring out with "Swarm is encrypted and needs to be unlocked before it can be used. Please use "docker swarm unlock" to unlock it." `test_rotate_manager_unlock_key` enables autolock and then rotates the manager unlock key, but teardown still holds the original key. If the swarm needs to be unlocked during cleanup, the stale key cannot unlock it and the daemon can remain in locked swarm state for the next test. Store the rotated unlock key so teardown can unlock and leave the swarm cleanly. Signed-off-by: Paweł Gronowski --- tests/integration/api_swarm_test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/integration/api_swarm_test.py b/tests/integration/api_swarm_test.py index 00477e1036..429533c711 100644 --- a/tests/integration/api_swarm_test.py +++ b/tests/integration/api_swarm_test.py @@ -249,6 +249,7 @@ def test_rotate_manager_unlock_key(self): rotate_manager_unlock_key=True ) key_2 = self.client.get_unlock_key() + self._unlock_key = key_2 assert key_1['UnlockKey'] != key_2['UnlockKey'] @requires_api_version('1.30')