From 62ed9da2665da8890c591d90d349750c849ca720 Mon Sep 17 00:00:00 2001 From: Tedi Mitiku Date: Thu, 7 Nov 2024 10:27:35 -0800 Subject: [PATCH] update tests --- .../persistent_volume_logs_database_client_test.go | 9 ++++----- .../engine/centralized_logs/logline/logline_sender.go | 7 +------ 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/engine/server/engine/centralized_logs/client_implementations/persistent_volume/persistent_volume_logs_database_client_test.go b/engine/server/engine/centralized_logs/client_implementations/persistent_volume/persistent_volume_logs_database_client_test.go index e0c54dcb49..21e898e30c 100644 --- a/engine/server/engine/centralized_logs/client_implementations/persistent_volume/persistent_volume_logs_database_client_test.go +++ b/engine/server/engine/centralized_logs/client_implementations/persistent_volume/persistent_volume_logs_database_client_test.go @@ -721,11 +721,10 @@ func executeStreamCallAndGetReceivedServiceLogLines( case <-time.Tick(testTimeOut): return nil, stacktrace.NewError("Receiving stream logs in the test has reached the '%v' time out", testTimeOut) case streamErr, isChanOpen := <-errChan: - if !isChanOpen && len(userServiceLogsByUuidChan) == 0 { - shouldReceiveStream = false - break - } - if streamErr == nil && !isChanOpen { + if !isChanOpen { + if len(userServiceLogsByUuidChan) == 0 { + shouldReceiveStream = false + } break } return nil, stacktrace.Propagate(streamErr, "Receiving streaming error.") diff --git a/engine/server/engine/centralized_logs/logline/logline_sender.go b/engine/server/engine/centralized_logs/logline/logline_sender.go index 705ee5d635..a51c274dfa 100644 --- a/engine/server/engine/centralized_logs/logline/logline_sender.go +++ b/engine/server/engine/centralized_logs/logline/logline_sender.go @@ -6,7 +6,7 @@ import ( ) const ( - batchLogsAmount = 2 + batchLogsAmount = 1 logsChanBufferSize = 300 ) @@ -63,8 +63,3 @@ func (sender *LogLineSender) Flush() { sender.logLineBuffer[serviceUuid] = []LogLine{} } } - -func (sender *LogLineSender) Close() { - sender.Flush() - close(sender.logsChan) -}