Ask Your Question
1

rostest kills roscore

asked 2011-07-08 02:49:50 -0500

seanarm gravatar image

updated 2011-07-08 02:50:41 -0500

I created a gtest test class for obvious reasons. I made the necessary adjustments to CMakefile.txt, and the package builds both the node and test executables fine. When I run 'make test', the tests complete with no failures. Then, I made a test launch file (armMotion.test) that contains the following:

<launch>
<test test-name="arm_motion_test" name="arm_motion" pkg="arm_motion" type="utest" time-limit="180"/>
</launch>

In the terminals that I will run this test file and my roscore, I change the ROS_URI_MASTER port to 22422. Then, I perform the command 'rostest --text armMotion.test'. As soon as I execute this, my roscore dies. From the master.log file:


" ... [INFO] 2011-07-07 19:15:35,639: +SUB [/LowerPanTilt/start_velocity_control] /LowerPanTilt/LowerPanTilt http://darpa-arm-gfe:41147/
[INFO] 2011-07-07 19:15:45,530: stopping master... "


In another log file: "
[INFO] 2011-07-07 19:15:45,390: rostest starting with options {'text_mode': True, 'bare_name': None, 'bare': False, 'bare_limit': 60}, args ['armMotion.test']
[INFO] 2011-07-07 19:15:45,390: loading roscore config file /home/arm_user/darpa_arm_cturtle/stacks/ros/tools/roslaunch/roscore.xml
[INFO] 2011-07-07 19:15:45,390: Added core node of type [rosout/rosout] in namespace [/]
[INFO] 2011-07-07 19:15:45,391: loading config file armMotion.test
[INFO] 2011-07-07 19:15:45,391: overriding master port to 22422
[INFO] 2011-07-07 19:15:45,391: ... selected machine [] for node of type [arm_motion/utest]
[INFO] 2011-07-07 19:15:45,460: setup[armMotion.test] run_id[0ae5d9fc-a8ef-11e0-b30b-b8ac6f4327b2] starting
[INFO] 2011-07-07 19:15:45,460: start_process_monitor: creating ProcessMonitor
[INFO] 2011-07-07 19:15:45,460: created process monitor <processmonitor(processmonitor-1, initial="" daemon)&gt;<br=""> [INFO] 2011-07-07 19:15:45,461: start_process_monitor: ProcessMonitor started
[INFO] 2011-07-07 19:15:45,461: starting parent XML-RPC server
[INFO] 2011-07-07 19:15:45,461: starting roslaunch XML-RPC server
[INFO] 2011-07-07 19:15:45,461: waiting for roslaunch XML-RPC server to initialize
[INFO] 2011-07-07 19:15:45,474: started roslaunch server http://darpa-arm-gfe:53403/
[INFO] 2011-07-07 19:15:45,474: ... parent XML-RPC server started
[INFO] 2011-07-07 19:15:45,475: _addRostestParent [<rostest.rostest_parent.rostestlaunchparent object="" at="" 0x11d8790="">]
[INFO] 2011-07-07 19:15:45,475: setup[armMotion.test] run_id[0ae5d9fc-a8ef-11e0-b30b-b8ac6f4327b2] done
[INFO] 2011-07-07 19:15:45,475: Running test [arm_motion_test]
[INFO] 2011-07-07 19:15:45,475: initial ROS_MASTER_URI is http://darpa-arm-gfe:22422/
[INFO] 2011-07-07 19:15:45,475: master.is_running[http://darpa-arm-gfe:22422/]
[INFO] 2011-07-07 19:15:45,477: master.is_running[http://darpa-arm-gfe:22422/]
[INFO] 2011-07-07 19:15:45,579: master.is_running[http://darpa-arm-gfe:22422/]
[INFO] 2011-07-07 19:15:45,580: master.is_running[http://darpa-arm-gfe:22422/]
[INFO] 2011-07-07 19:15:45,580: master.is_running[http://darpa-arm-gfe:22422/]
[INFO] 2011-07-07 19:15:45,580: starting new master (master configured for auto restart)
[INFO] 2011-07-07 19:15:45,580: create_master_process: rosmaster, /home/arm_user/darpa_arm_cturtle/stacks/ros, 22422
[INFO] 2011-07-07 19:15:45,580: ProcessMonitor.register[master]
[INFO] 2011-07-07 19:15:45,581: ProcessMonitor.register[master] complete
[INFO] 2011-07-07 19:15:45,583: master.is_running[http://darpa-arm-gfe:22422/]
[INFO] 2011-07-07 19:15:45,683: master.is_running[http://darpa-arm-gfe:22422/]
[INFO] 2011-07-07 19:15:45 ...





























(more)
edit retag flag offensive close merge delete

Comments

You mention that you change ROS_URI_MASTER. It should be ROS_MASTER_URI, but from your log it seems you did it right anyway
Felix Endres gravatar imageFelix Endres ( 2011-07-08 03:07:56 -0500 )edit
Temporary dyslexia.. but I'm glad to have finally incurred the wrath of the robot devil.
seanarm gravatar imageseanarm ( 2011-07-08 03:14:58 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2011-07-08 03:10:29 -0500

dornhege gravatar image

Your guess is right. rostest tries to bring up its own ros environment to create an isolated test.

The idea is that you put all the things you want to test in the launch/test file.

edit flag offensive delete link more

Comments

Is there anyway to prevent the behavior?
seanarm gravatar imageseanarm ( 2011-07-08 03:15:52 -0500 )edit
1
no, there is no way to change this behavior right now. It's intentional -- in order for the integration test to be repeatable, every test runs in a fresh graph. rostest files are just roslaunch files, so you can 'roslaunch' them and then run your gtest by hand.
kwc gravatar imagekwc ( 2011-07-08 05:58:55 -0500 )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

Stats

Asked: 2011-07-08 02:49:50 -0500

Seen: 459 times

Last updated: Jul 08 '11