From: Vsevolod Stakhov Date: Mon, 25 May 2026 20:00:43 +0000 (+0100) Subject: [Test] 411_logging: read per-suite rspamd output, not global .last X-Git-Tag: 4.1.0~21 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=640e672dbbfd54839b1798148432d42eb48df552;p=thirdparty%2Frspamd.git [Test] 411_logging: read per-suite rspamd output, not global .last save_run_results writes each rspamd's logs to two destinations: the stable per-suite/per-test directory under robot-save/, and a global robot-save/.last "convenience" copy of the most recent run. The three 411_logging tests asserted on the .last copies. Under pabot another worker can teardown -- and overwrite the .last files -- between this suite's Rspamd Teardown saving them and the assertion reading them, so the assertion ends up running against a different suite's rspamd output and matching the wrong format. Switch to the per-suite paths (robot-save/${SUITE_NAME}/rspamd.stderr for the console suites, robot-save/${SUITE_NAME}/${TEST_NAME}/rspamd.log for the JSON file test). Those paths aren't shared across pabot workers. Local: three back-to-back parallel runs of the 411_logging directory pass 3/3 each time. --- diff --git a/test/functional/cases/411_logging/000_console/000_systemd_logger.robot b/test/functional/cases/411_logging/000_console/000_systemd_logger.robot index 88178461bb..0cd24bf131 100644 --- a/test/functional/cases/411_logging/000_console/000_systemd_logger.robot +++ b/test/functional/cases/411_logging/000_console/000_systemd_logger.robot @@ -20,5 +20,7 @@ EMPTY TEST Systemd Teardown Touch ${RSPAMD_TMPDIR}/rspamd.log Rspamd Teardown - ${log} = Get File ${EXECDIR}/robot-save/rspamd.stderr.last + # See sibling 001_timestamps.robot for why .last is unsafe under + # parallel pabot -- read the per-suite save instead. + ${log} = Get File ${EXECDIR}/robot-save/${SUITE_NAME}/rspamd.stderr Should Match Regexp ${log} \\n\\(main\\) lua; lua_cfg_transform\\.lua:\\d+: overriding actions from the legacy metric settings\\n diff --git a/test/functional/cases/411_logging/000_console/001_timestamps.robot b/test/functional/cases/411_logging/000_console/001_timestamps.robot index bd8e2c3493..12160b033e 100644 --- a/test/functional/cases/411_logging/000_console/001_timestamps.robot +++ b/test/functional/cases/411_logging/000_console/001_timestamps.robot @@ -20,5 +20,9 @@ EMPTY TEST Console Timestamps Teardown Touch ${RSPAMD_TMPDIR}/rspamd.log Rspamd Teardown - ${log} = Get File ${EXECDIR}/robot-save/rspamd.stderr.last + # robot-save/rspamd.stderr.last is the cross-suite "last run" copy + # of whatever rspamd.stderr was last torn down; under pabot another + # worker can overwrite it between Rspamd Teardown saving it and us + # reading it. The per-suite save_run_results destination is stable. + ${log} = Get File ${EXECDIR}/robot-save/${SUITE_NAME}/rspamd.stderr Should Match Regexp ${log} \\n\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2} #\\d+\\(main\\) lua; lua_cfg_transform\\.lua:\\d+: overriding actions from the legacy metric settings\\n diff --git a/test/functional/cases/411_logging/001_file/000_json.robot b/test/functional/cases/411_logging/001_file/000_json.robot index a2f04e85c7..0e6f004410 100644 --- a/test/functional/cases/411_logging/001_file/000_json.robot +++ b/test/functional/cases/411_logging/001_file/000_json.robot @@ -14,4 +14,7 @@ ${RSPAMD_SCOPE} Test *** Test Cases *** JSON LOGS Rspamd Teardown - Check JSON Log ${EXECDIR}/robot-save/rspamd.log.last + # robot-save/rspamd.log.last is the global "last run" file and can + # be overwritten by another pabot worker's teardown between us + # writing it and reading it. Read the per-suite/per-test copy. + Check JSON Log ${EXECDIR}/robot-save/${SUITE_NAME}/${TEST_NAME}/rspamd.log