]> source.dussan.org Git - rspamd.git/commitdiff
[Test] Improve startup error handling
authorAndrew Lewis <nerf@judo.za.org>
Fri, 23 Aug 2024 15:04:52 +0000 (17:04 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Fri, 23 Aug 2024 15:04:52 +0000 (17:04 +0200)
test/functional/lib/rspamd.robot

index c45a19908b18eda4b61880f9169f22b4ee36d3fa..559ec667b6c4f949b867c05b04b118989781406c 100644 (file)
@@ -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