diff options
author | Andrew Lewis <nerf@judo.za.org> | 2024-08-23 17:04:52 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2024-08-23 17:04:52 +0200 |
commit | 366e875b82d1e2ae6b7987b9eaabc5c1afca089c (patch) | |
tree | 037dcd899ea05cf89417af562b4d957a7f5a401f /test/functional | |
parent | 8fe1612bdb6572fc60284190351ed4075d72402a (diff) | |
download | rspamd-366e875b82d1e2ae6b7987b9eaabc5c1afca089c.tar.gz rspamd-366e875b82d1e2ae6b7987b9eaabc5c1afca089c.zip |
[Test] Improve startup error handling
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/lib/rspamd.robot | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/test/functional/lib/rspamd.robot b/test/functional/lib/rspamd.robot index c45a19908..559ec667b 100644 --- a/test/functional/lib/rspamd.robot +++ b/test/functional/lib/rspamd.robot @@ -345,7 +345,22 @@ Run Rspamd Export Scoped Variables ${RSPAMD_SCOPE} RSPAMD_PROCESS=${result} # Confirm worker is reachable - Wait Until Keyword Succeeds 15x 1 sec Ping Rspamd ${RSPAMD_LOCAL_ADDR} ${check_port} + FOR ${index} IN RANGE 75 + ${ok} = Rspamd Startup Check ${check_port} + IF ${ok} CONTINUE + Sleep 0.1s + END + +Rspamd Startup Check + [Arguments] ${check_port}=${RSPAMD_PORT_NORMAL} + ${res} = Wait For Process ${RSPAMD_PROCESS} 0.1s + ${handle} = Get Process Object + ${res} = Evaluate $handle.poll() + IF ${res} != None + Fail Process Is Gone + END + ${ping} = Run Keyword And Return Status Ping Rspamd ${RSPAMD_LOCAL_ADDR} ${check_port} + [Return] ${ping} Rspamadm Setup ${RSPAMADM_TMPDIR} = Make Temporary Directory |