diff --git a/score/mw/com/impl/bindings/lola/proxy_method.cpp b/score/mw/com/impl/bindings/lola/proxy_method.cpp index a9412c1fb..2f93c91b3 100644 --- a/score/mw/com/impl/bindings/lola/proxy_method.cpp +++ b/score/mw/com/impl/bindings/lola/proxy_method.cpp @@ -85,6 +85,7 @@ score::Result> ProxyMethod::GetReturnValueBuffer(std score::Result ProxyMethod::DoCall(std::size_t queue_position) { + std::cout << "DoCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaall" << std::endl; if (!is_subscribed_) { score::mw::log::LogError("lola") diff --git a/score/mw/com/impl/bindings/lola/service_discovery/client/service_discovery_client.cpp b/score/mw/com/impl/bindings/lola/service_discovery/client/service_discovery_client.cpp index d569b1c8f..97b92870c 100644 --- a/score/mw/com/impl/bindings/lola/service_discovery/client/service_discovery_client.cpp +++ b/score/mw/com/impl/bindings/lola/service_discovery/client/service_discovery_client.cpp @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -392,6 +393,12 @@ auto ServiceDiscoveryClient::HandleEvents( const auto& events = expected_events.value(); + std::stringstream handle_events_log{}; + handle_events_log << "\n\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n"; + handle_events_log << "Inotify HandleEvents: received " << events.size() << " event(s) / pid=" << ::getpid(); + handle_events_log << "\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n"; + std::cout << handle_events_log.str() << std::endl; + std::vector deletion_events{}; std::vector creation_events{}; for (const auto& event : events) @@ -403,6 +410,36 @@ auto ServiceDiscoveryClient::HandleEvents( const bool inode_was_removed = search_directory_was_removed || flag_file_was_removed; const bool inode_was_created = ReadMaskSet(event, os::InotifyEvent::ReadMask::kInCreate); + auto watch_descriptor = event.GetWatchDescriptor(); + auto watch_iter = watches_.find(watch_descriptor); + if (watch_iter == watches_.end()) + { + std::cout << "Received event for unknown watch descriptor: " << watch_descriptor.GetUnderlying() + << std::endl; + } + auto watch = watch_iter->second; + + auto path = GetSearchPathForIdentifier(watch.enriched_instance_identifier); + + std::stringstream event_log{}; + event_log << "Inotify event" + << " / pid=" << ::getpid() << " / wd=" << event.GetWatchDescriptor().GetUnderlying() << " / mask=0x" + << std::hex << static_cast(event.GetMask()) << std::dec + << " / name=" << event.GetName().data() << " / q_overflow=" << inotify_queue_overflowed + << " / dir_removed=" << search_directory_was_removed << " / flag_removed=" << flag_file_was_removed; + + if (filesystem_.standard->Exists(path).value()) + { + event_log << " / removed_path=" << path; + } + else + { + event_log << " / removed_path=COULDNT FINT PATH"; + }; + + event_log << " / created=" << inode_was_created; + std::cout << event_log.str() << std::endl; + if (inotify_queue_overflowed) { mw::log::LogError("lola") @@ -459,7 +496,14 @@ auto ServiceDiscoveryClient::HandleDeletionEvents(const std::vectorsecond; if (file_was_deleted) diff --git a/score/mw/com/impl/methods/proxy_method_with_in_args_and_return.h b/score/mw/com/impl/methods/proxy_method_with_in_args_and_return.h index 480ce48cc..07de0e1b1 100644 --- a/score/mw/com/impl/methods/proxy_method_with_in_args_and_return.h +++ b/score/mw/com/impl/methods/proxy_method_with_in_args_and_return.h @@ -195,11 +195,13 @@ score::Result> ProxyMethodGetReturnValueBuffer(queue_position); if (!allocated_return_type_storage.has_value()) { + score::mw::log::LogError("lola") << "Return value failed for the method: " << method_name_; return Unexpected(allocated_return_type_storage.error()); } auto call_result = binding_->DoCall(queue_position); if (!call_result.has_value()) { + score::mw::log::LogError("lola") << "DoCall failed for method: " << method_name_; return Unexpected(call_result.error()); } diff --git a/score/mw/com/test/methods/edge_cases_test/BUILD b/score/mw/com/test/methods/edge_cases_test/BUILD index f8cb75798..040c2088e 100644 --- a/score/mw/com/test/methods/edge_cases_test/BUILD +++ b/score/mw/com/test/methods/edge_cases_test/BUILD @@ -96,7 +96,7 @@ pkg_application( ], etc = [ "config/disabled_methods_mw_com_config.json", - "config/logging.json", + # "config/logging.json", "config/mw_com_config.json", ], visibility = [ diff --git a/score/mw/com/test/methods/edge_cases_test/integration_test/BUILD b/score/mw/com/test/methods/edge_cases_test/integration_test/BUILD index a1c4ec8f4..f417e417b 100644 --- a/score/mw/com/test/methods/edge_cases_test/integration_test/BUILD +++ b/score/mw/com/test/methods/edge_cases_test/integration_test/BUILD @@ -55,5 +55,5 @@ integration_test( # To be enabled on qnx once the bug is fixed or # service discovery is reimplemented to not rely on # inotify events (SWP-214271). - target_compatible_with = ["@platforms//os:linux"], + # target_compatible_with = ["@platforms//os:linux"], ) diff --git a/score/mw/com/test/methods/edge_cases_test/skeleton_recreation_test.cpp b/score/mw/com/test/methods/edge_cases_test/skeleton_recreation_test.cpp index 507d6d696..f366b26d9 100644 --- a/score/mw/com/test/methods/edge_cases_test/skeleton_recreation_test.cpp +++ b/score/mw/com/test/methods/edge_cases_test/skeleton_recreation_test.cpp @@ -178,6 +178,7 @@ int main(int argc, const char** argv) } score::mw::com::test::RunSkeletonRecreationWithNewProxyTest(); + // std::this_thread::sleep_for(std::chrono::seconds{2}); score::mw::com::test::RunSkeletonRecreationWithSameProxyTest(stop_source.get_token()); return EXIT_SUCCESS; diff --git a/score/mw/com/test/methods/methods_test_resources/all_signatures_datatype/all_signatures_method_consumer.cpp b/score/mw/com/test/methods/methods_test_resources/all_signatures_datatype/all_signatures_method_consumer.cpp index ab2e9c653..830d5a780 100644 --- a/score/mw/com/test/methods/methods_test_resources/all_signatures_datatype/all_signatures_method_consumer.cpp +++ b/score/mw/com/test/methods/methods_test_resources/all_signatures_datatype/all_signatures_method_consumer.cpp @@ -13,6 +13,8 @@ #include "score/mw/com/test/methods/methods_test_resources/all_signatures_datatype/all_signatures_method_consumer.h" #include "score/mw/com/test/common_test_resources/fail_test.h" +#include +#include namespace score::mw::com::test { @@ -46,7 +48,7 @@ void AllSignaturesMethodConsumer::CallMethodWithInArgsAndReturn(const std::int32 auto allocated_args_result = proxy.with_in_args_and_return.Allocate(); if (!allocated_args_result.has_value()) { - std::cerr << "Consumer: Could not allocate method args: " << allocated_args_result.error() << std::endl; + std::cout << "Consumer: Could not allocate method args: " << allocated_args_result.error() << std::endl; return Unexpected(allocated_args_result.error()); } @@ -64,6 +66,7 @@ void AllSignaturesMethodConsumer::CallMethodWithInArgsAndReturn(const std::int32 }(); if (!call_result.has_value()) { + std::this_thread::sleep_for(std::chrono::seconds{2}); FailTest(failure_message_prefix, " Consumer: with_in_args_and_return call failed: ", call_result.error()); } const auto return_value = *(call_result.value());