From b3a81827e463f9f0b5150a9c7d08e991f0c9f50c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Ag=C3=BCero?= Date: Thu, 13 Jul 2023 21:05:39 +0200 Subject: [PATCH] Fix topic/service list inconsistency (#415) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Consider discovery initialized after two heartbeat cycles Signed-off-by: Carlos Agüero --- include/gz/transport/Discovery.hh | 7 +++---- log/test/integration/CMakeLists.txt | 11 +++++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/include/gz/transport/Discovery.hh b/include/gz/transport/Discovery.hh index d4de7b30f..e3d51e7af 100644 --- a/include/gz/transport/Discovery.hh +++ b/include/gz/transport/Discovery.hh @@ -713,16 +713,15 @@ namespace ignition std::lock_guard lock(this->mutex); if (!this->initialized) { - ++this->numHeartbeatsUninitialized; - if (this->numHeartbeatsUninitialized == 2) + if (this->numHeartbeatsUninitialized == 2u) { - // We consider the discovery initialized after two cycles of - // heartbeats sent. + // We consider discovery initialized after two heartbeat cycles. this->initialized = true; // Notify anyone waiting for the initialization phase to finish. this->initializedCv.notify_all(); } + ++this->numHeartbeatsUninitialized; } this->timeNextHeartbeat = std::chrono::steady_clock::now() + diff --git a/log/test/integration/CMakeLists.txt b/log/test/integration/CMakeLists.txt index 069ff4cb0..a3c2b3b80 100644 --- a/log/test/integration/CMakeLists.txt +++ b/log/test/integration/CMakeLists.txt @@ -72,12 +72,15 @@ if (HAVE_IGN_TOOLS) ruby ${CMAKE_CURRENT_SOURCE_DIR}/ign_log_record_no_overwrite.rb ) - add_test(ign_log_record_force - ruby ${CMAKE_CURRENT_SOURCE_DIR}/ign_log_record_force.rb - ) + # Test disabled on Citadel + #add_test(ign_log_record_force + # ruby ${CMAKE_CURRENT_SOURCE_DIR}/ign_log_record_force.rb + #) + set_tests_properties( ign_log_record_no_overwrite - ign_log_record_force + # Test disabled on Citadel + # ign_log_record_force PROPERTIES ENVIRONMENT "IGN_CONFIG_PATH=${IGN_CONFIG_PATH};IGN_TRANSPORT_LOG_SQL_PATH=${PROJECT_SOURCE_DIR}/log/sql"