From b449d86c72b33348d564ef141ad34b46797bfbf1 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Mon, 2 Nov 2026 14:27:19 +0200 Subject: [PATCH] matrix-synapse-auto-compressor: wait for both networks before inspecting the Molecule container The unit creates the container and attaches additional networks in later ExecStartPre steps. Verify could inspect it in between and flakily fail the network contract assertion. Co-Authored-By: Claude Opus 5.5 --- .../molecule/default/verify.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/roles/custom/matrix-synapse-auto-compressor/molecule/default/verify.yml b/roles/custom/matrix-synapse-auto-compressor/molecule/default/verify.yml index 7df084117..a6566f555 100644 --- a/roles/custom/matrix-synapse-auto-compressor/molecule/default/verify.yml +++ b/roles/custom/matrix-synapse-auto-compressor/molecule/default/verify.yml @@ -413,7 +413,9 @@ no_block: true changed_when: true - - name: Wait for the transient compressor container to become inspectable + # The unit creates the container first and attaches additional networks in later ExecStartPre steps. + # Waiting for both networks avoids inspecting the container in between. + - name: Wait for the transient compressor container to become inspectable with both networks attached ansible.builtin.command: argv: - docker @@ -422,7 +424,9 @@ - matrix-synapse-auto-compressor register: matrix_synapse_auto_compressor_container_inspect changed_when: false - until: matrix_synapse_auto_compressor_container_inspect.rc == 0 + until: >- + matrix_synapse_auto_compressor_container_inspect.rc == 0 + and ((matrix_synapse_auto_compressor_container_inspect.stdout | from_json | first).NetworkSettings.Networks | length) == 2 retries: 30 delay: 1 failed_when: false