Connecting to the rostest master
Connecting to the rostest roscore is difficult as rostest restarts it for each test in order to have a clean test fixture. Also, rostest uses port 22422 to not conflict with any running roscore instance. Thus, to connect to the rostest Master from another terminal you must first:
export ROS_MASTER_URI=http://localhost:22422
A different approach to connecting to the volatile rostest roscore is to run your test file using roslaunch. You can then manually launch your test node to observe it's behavior.






