Multiple Cores running in rostest
I'm running tests in the latest navigation branch, but keep getting errors when I run
catkin_make run_tests
The errors claim that there is already a roscore instance open on that port. Full output of the command is seen here but the relevant bit is...
-- run_tests.py: execute commands
/opt/ros/groovy/bin/rostest --pkgdir=/home/dlu/catkin/src/navigation/costmap_2d --package=costmap_2d --results-filename test_simple_driving_test.xml /home/dlu/catkin/src/navigation/costmap_2d/test/simple_driving_test.xml
... logging to /home/dlu/.ros/log/rostest-serenity-8918.log
[ROSUNIT] Outputting test results to /home/dlu/catkin/build/test_results/costmap_2d/rostest-test_simple_driving_test.xml
[ WARN] [1368241605.099039962]: Message from [/rosbag] has a non-fully-qualified frame_id [base_laser]. Resolved locally to [/base_laser]. This is will likely not work in multi-robot systems. This message will only print once.
[ WARN] [1368241605.108304546, 19.527194170]: No laser scan received (and thus no pose updates have been published) for 19.527194 seconds. Verify that data is being published on the /base_scan topic.
testsimple_driving_test ... ERROR!
ERROR: roscore cannot run as another roscore/master is already running.
Please kill other roscore/master processes before relaunching.
The ROS_MASTER_URI is http://serenity:22422/
File "/usr/lib/python2.7/unittest/case.py", line 332, in run
testMethod()
File "/opt/ros/groovy/lib/python2.7/dist-packages/rostest/runner.py", line 121, in fn
succeeded, failed = self.test_parent.launch()
File "/opt/ros/groovy/lib/python2.7/dist-packages/rostest/rostest_parent.py", line 81, in launch
return self.runner.launch()
File "/opt/ros/groovy/lib/python2.7/dist-packages/roslaunch/launch.py", line 644, in launch
self._setup()
File "/opt/ros/groovy/lib/python2.7/dist-packages/roslaunch/launch.py", line 620, in _setup
self._launch_master()
File "/opt/ros/groovy/lib/python2.7/dist-packages/roslaunch/launch.py", line 381, in _launch_master
raise RLException("roscore cannot run as another roscore/master is already running. \nPlease kill other roscore/master processes before relaunching.\nThe ROS_MASTER_URI is %s"%(m.uri))
--------------------------------------------------------------------------------
However running the tests with the individual command works just fine.
/opt/ros/groovy/bin/rostest --pkgdir=/home/dlu/catkin/src/navigation/costmap_2d --package=costmap_2d --results-filename test_simple_driving_test.xml /home/dlu/catkin/src/navigation/costmap_2d/test/simple_driving_test.xml
The CMake command for the above listed test is...
add_rostest(test/simple_driving_test.xml)
catkin_add_gtest(module_tests test/module_tests.cpp)
In the words of "David after Dentist," "WHY IS THIS HAPPENING? IS THIS GOING TO BE FOREVER?"
What do the unit test commands in your CMakeLists.txt look like? (Please edit your question.)