Jan_31_2024-Dev

This commit is contained in:
Ned Wright
2024-01-31 17:34:53 +00:00
parent 752a5785f0
commit 6d67818a94
376 changed files with 8101 additions and 7064 deletions

View File

@@ -166,11 +166,16 @@ private:
bool
sendHealthCheckPatch()
{
dbgFlow(D_HEALTH_CHECK_MANAGER);
dbgFlow(D_HEALTH_CHECK_MANAGER) << "Sending a health check patch";
HealthCheckPatch patch_to_send(general_health_aggregated_status, all_comps_health_status);
auto messaging = Singleton::Consume<I_Messaging>::by<HealthCheckManager>();
return messaging->sendNoReplyObject(patch_to_send, I_Messaging::Method::PATCH, "/agents");
return messaging->sendSyncMessageWithoutResponse(
HTTPMethod::PATCH,
"/agents",
patch_to_send,
MessageCategory::GENERIC
);
}
void

View File

@@ -4,5 +4,5 @@ link_directories(${BOOST_ROOT}/lib)
add_unit_test(
health_check_manager_ut
"health_check_manager_ut.cc"
"singleton;mainloop;health_check_manager;event_is;metric;-lboost_regex"
"singleton;messaging;mainloop;health_check_manager;event_is;metric;-lboost_regex"
)

View File

@@ -111,19 +111,18 @@ public:
TEST_F(HealthCheckManagerTest, runPeriodicHealthCheckTest)
{
string actual_body;
EXPECT_CALL(
mock_message,
sendMessage(
false,
_,
I_Messaging::Method::PATCH,
"/agents",
"",
_,
_,
MessageTypeTag::GENERIC
EXPECT_CALL(mock_message, sendSyncMessage(
HTTPMethod::PATCH,
"/agents",
_,
_,
_
)).Times(4).WillRepeatedly(
DoAll(
SaveArg<2>(&actual_body),
Return(HTTPResponse(HTTPStatusCode::HTTP_OK, ""))
)
).Times(4).WillRepeatedly(DoAll(SaveArg<1>(&actual_body), Return(string())));
);
try {
health_check_periodic_routine();