personalrobotics / prpy

Python utilities used by the Personal Robotics Laboratory.
BSD 3-Clause "New" or "Revised" License
62 stars 19 forks source link

Add a new unit test for clone env leakage. #288

Open psigen opened 8 years ago

psigen commented 8 years ago

After the discovery of #286, we should add a unit test that verifies that cloning and planning operations do not leak OpenRAVE environments. This would be something to the effect of:

import openravepy

robot.PlanToConfiguration(robot.GetActiveDOFValues(), execute=True)
initial_num_envs = len(openravepy.RaveGetEnvironments())
for i in range(10):
    robot.PlanToConfiguration(robot.GetActiveDOFValues(), execute=True)
assertEqual(initial_num_envs, openravepy.RaveGetEnvironments())

I am not sure exactly how to do this test in prpy directly (without herbpy or similar).

mkoval commented 8 years ago

It may be best to put this code in each *py package. It's possible for a robot to introduce circular dependencies in its CloneBindings functions, so that is the most reliably place to do the test.