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/<file>.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.
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
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
*** 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