Skip to content

Commit

Permalink
Merge branch 'gz-sim9' into Amal-python-system-GIL
Browse files Browse the repository at this point in the history
  • Loading branch information
AmalDevHaridevan authored Sep 12, 2024
2 parents 9df6542 + 0f16949 commit ccf90c5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/SimulationRunner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1596,8 +1596,6 @@ void SimulationRunner::CreateEntities(const sdf::World &_world)
this->entityCompMgr.ProcessRemoveEntityRequests();
this->entityCompMgr.ClearRemovedComponents();

this->LoadLoggingPlugins(this->serverConfig);

// Load any additional plugins from the Server Configuration
this->LoadServerPlugins(this->serverConfig.Plugins());

Expand Down Expand Up @@ -1653,6 +1651,11 @@ void SimulationRunner::CreateEntities(const sdf::World &_world)
}

this->LoadServerPlugins(defaultPlugins);
// Load logging plugins after all server plugins so that necessary
// plugins such as SceneBroadcaster are loaded first. This might be
// a bug or an assumption made in the logging plugins.
this->LoadLoggingPlugins(this->serverConfig);

};

// Store the initial state of the ECM;
Expand Down
15 changes: 15 additions & 0 deletions test/integration/log_system.cc
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,18 @@ TEST_F(LogSystemTest, GZ_UTILS_TEST_DISABLED_ON_WIN32(RecordAndPlayback))
// Start server
Server playServer(playServerConfig);

// Simulate a client
gz::transport::Node node;
std::atomic<std::size_t> numMsgs = 0;
std::function<void(const msgs::SerializedStepMap &)> mockClient =
[&](const msgs::SerializedStepMap &/*_res*/)
{
numMsgs++;
};
using namespace std::placeholders;
EXPECT_TRUE(node.Subscribe(
"/world/default/state", mockClient));

// Callback function for entities played back
// Compare current pose being played back with the pose from the stateMsg
test::Relay playbackPoseTester;
Expand Down Expand Up @@ -837,6 +849,9 @@ TEST_F(LogSystemTest, GZ_UTILS_TEST_DISABLED_ON_WIN32(RecordAndPlayback))
// checked in the playbackPoseTester
playServer.Run(true, 500, false);

// The client should have received some messages.
EXPECT_NE(numMsgs, 0);

// Count the total number of state messages in the log file
int nTotal{0};
for (auto it = batch.begin(); it != batch.end(); ++it, ++nTotal) { }
Expand Down

0 comments on commit ccf90c5

Please sign in to comment.