From e1afec5b08a82092271376b4fc909c91de89e260 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 4 Mar 2026 16:02:47 +0100 Subject: [PATCH] tests: wait for rspamd-milter.sock in ldap and internal tests I've hit more races in these tests recently while running the test suite on a much faster host system. --- tests/internal.nix | 5 +++++ tests/ldap.nix | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/tests/internal.nix b/tests/internal.nix index 988d5c4..e62eb32 100644 --- a/tests/internal.nix +++ b/tests/internal.nix @@ -115,6 +115,11 @@ in machine.wait_for_unit("multi-user.target") machine.wait_for_unit("dovecot.service") + # TODO put this blocking into the systemd units? + machine.wait_until_succeeds( + "set +e; timeout 1 nc -U /run/rspamd/rspamd-milter.sock < /dev/null; [ $? -eq 124 ]" + ) + # Regression test for https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/issues/205 with subtest("mail forwarded can are locally kept"): # A mail sent to user2@example.com via explicit TLS is in the user1@example.com mailbox diff --git a/tests/ldap.nix b/tests/ldap.nix index 4d0675a..9cff68f 100644 --- a/tests/ldap.nix +++ b/tests/ldap.nix @@ -128,6 +128,11 @@ in machine.start() machine.wait_for_unit("multi-user.target") + # TODO put this blocking into the systemd units? + machine.wait_until_succeeds( + "set +e; timeout 1 nc -U /run/rspamd/rspamd-milter.sock < /dev/null; [ $? -eq 124 ]" + ) + # This function retrieves the ldap table file from a postconf # command. # A key lookup is achived and the returned value is compared