Skip to content

test: report failed Test App listener POSTs on stderr, not in the test body - #5415

Open
ShryukGrandhi wants to merge 1 commit into
MarketSquare:mainfrom
ShryukGrandhi:fix/issue-5360-test-app-listener-s-post-failure-shifts
Open

ShryukGrandhi wants to merge 1 commit into
MarketSquare:mainfrom
ShryukGrandhi:fix/issue-5360-test-app-listener-s-post-failure-shifts

Conversation

@ShryukGrandhi

Copy link
Copy Markdown
Contributor

Summary

atest/library/test_app_listener.py logged a failed POST to the Test App with robot.api.logger.debug. When that happened in start_test, the message became the first item in the test body, ahead of the first keyword, so a [Documentation] check like LOG 1.1:... pointed at the message and robotstatuschecker failed a test whose keywords all passed (seen on the Windows BrowserBatteries job in #5358).

Changes

  • The listener now prints the failed-POST message to sys.__stderr__ instead of the Robot Framework log, so it never lands in a test or suite body. It still shows up in the console / pabot worker output.
  • New utest/test_test_app_listener.py runs a one-keyword suite with the listener, --loglevel DEBUG and ${SERVER} pointing at a closed port, and checks the test body contains only the keyword.

The 2 s timeout is unchanged. Once this is on main, the known cause can be added to tools/ci_failures/known_causes.json.

Testing

  • Reproduced first: with the old listener the test body was [Message, Keyword, Message]; the new unit test fails on the old listener and passes with the fix.
  • pytest --no-cov utest/test_test_app_listener.py passes.
  • ruff format --check on the touched files is clean.

Fixes #5360

…t body

A failed POST from start_test was logged with robot.api.logger, which put
the message ahead of the test's first keyword and broke LOG 1.1 checks in
robotstatuschecker.

Fixes MarketSquare#5360

Signed-off-by: ShryukGrandhi <85529990+ShryukGrandhi@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test App listener's POST failure shifts the log of the test, so robotstatuschecker fails it

1 participant