Ask Your Question

Rostest succeeds test if a node crashes

asked 2019-07-01 15:04:59 -0600

okalachev gravatar image

updated 2019-07-01 15:05:28 -0600

If a node in a test-case crashed, rostest doesn't care about it, and succeeds the testcase.

For example:

$ rostest somepkg basic.test
... logging to /home/parallels/.ros/log/rostest-parallels-vm-6224.log
[ROSUNIT] Outputting test results to /home/parallels/.ros/test_results/somepkg/rostest-test_basic.xml
Traceback (most recent call last):
  File "/home/parallels/catkin_ws/src/somepkg/src/", line 3, in <module>
    print 1/0
ZeroDivisionError: integer division or modulo by zero
[Testcase: testbasic_test] ... ok



 * TESTS: 1
 * ERRORS: 0

rostest log file is in /home/parallels/.ros/log/rostest-parallels-vm-6224.log

How to make rostest fail the test if a node crashes?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2019-07-04 14:47:27 -0600

okalachev gravatar image

Actually, to make the nodes "required" is kind of a solution.

edit flag offensive delete link more

answered 2019-07-01 20:19:58 -0600

130s gravatar image

updated 2019-07-01 20:46:12 -0600

I can't tell for certain without looking at your test case definition, but the following error you're seeing is what (and/or underlining modules) returned, not your test case.

ZeroDivisionError: integer division or modulo by zero

Unless at least one of your test cases finish with certain error state, rostest passes.

Writing test cases is covered on

edit flag offensive delete link more


Yeah, but it doesn't make sense. If one of my nodes just has fallen, why in the world we can consider that our tests are successful?

okalachev gravatar image okalachev  ( 2019-07-04 14:44:55 -0600 )edit

Actually, I found kind of solution, if a "required" node falls, then tests fall too. The only problem is that I don't want to make all of nodes "required" in my launch-files I want to test.

okalachev gravatar image okalachev  ( 2019-07-04 14:45:56 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2019-07-01 15:04:59 -0600

Seen: 157 times

Last updated: Jul 04 '19