gazebosim / gazebo-classic

Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
http://classic.gazebosim.org/
Other
1.19k stars 481 forks source link

ModelDatabase only active for first regression test in multi-test file #660

Closed osrf-migration closed 11 years ago

osrf-migration commented 11 years ago

Original report (archived issue) by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


The Physics.RevoluteJoint tests are failing since they are unable to download the double_pendulum_with_base model. Some debugging indicated that the ModelDatabase thread gets killed after the first test (EmptyWorldODE in this case) and the ModelDatabase::modelCache variable is cleared, so that no new models can be downloaded. I don't notice this in testing on my local machine because I have a local copy of gazebo_models in my path.

Currently common::ModelDatabase::Instance()->Fini(); destroys the ModelDatabase thread and is called in World::Stop. Since the ModelDatabase thread is created in its constructor, it never gets recreated. Perhaps creating the thread in ModelDatabase::Init?

osrf-migration commented 11 years ago

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


A workaround is to change the order of tests in physics.cc

diff -r 519a3b14f23af79096868d0e037046137f1572ac test/regression/physics.cc
--- a/test/regression/physics.cc    Mon Apr 22 16:07:44 2013 -0700
+++ b/test/regression/physics.cc    Tue Apr 23 09:40:48 2013 -0700
@@ -33,6 +33,13 @@
   public: void CollisionFiltering(const std::string &_physicsEngine);
 };

+// As a workaround for issue #660, this test is placed first.
+// When issue #660 is resolved, this can be moved back.
+TEST_F(PhysicsTest, RevoluteJointODE)
+{
+  RevoluteJoint("ode");
+}
+
 ////////////////////////////////////////////////////////////////////////
 // EmptyWorld:
 // Load a world, take a few steps, and verify that time is increasing.
@@ -921,11 +928,6 @@
   }
 }

-TEST_F(PhysicsTest, RevoluteJointODE)
-{
-  RevoluteJoint("ode");
-}
-
 #ifdef HAVE_BULLET
 TEST_F(PhysicsTest, RevoluteJointBullet)
 {
osrf-migration commented 11 years ago

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


The workaround was implemented in pull request #482, be sure restore the test order once this issue is fixed.

osrf-migration commented 11 years ago

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


It looks like ModelDatabase::Fini was added in d23f5ae16e3fd283167821e01502deb3338a61a0 and merged in pull request #414.

osrf-migration commented 11 years ago

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


See pull request #485

osrf-migration commented 11 years ago

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


Resolved in pull request #485

osrf-migration commented 8 years ago

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


osrf-migration commented 8 years ago

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).