Skip to content

Commit

Permalink
revert timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
tedim52 committed Nov 8, 2024
1 parent 6165b66 commit f868ae9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (client *persistentVolumeLogsDatabaseClient) StreamUserServiceLogs(
// wait for stream go routine to end
wgSenders.Wait()

// flush should send remainder of logs in the channel
// flush should send remainder of logs in the buffer to the channel to be read
logLineSender.Flush()

close(logsByKurtosisUserServiceUuidChan)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const (
notFoundedFilterText = "it shouldn't be found in the log lines"
firstMatchRegexFilterStr = "Starting.*idempotently'"

testTimeOut = 15 * time.Second
testTimeOut = 2 * time.Minute
doNotFollowLogs = false

defaultYear = 2023
Expand Down Expand Up @@ -719,7 +719,7 @@ func executeStreamCallAndGetReceivedServiceLogLines(
for shouldReceiveStream {
select {
case <-time.Tick(testTimeOut):
return receivedServiceLogsByUuid, nil
return nil, stacktrace.NewError("Receiving stream logs in the test has reached the '%v' time out", testTimeOut)
case streamErr, isChanOpen := <-errChan:
if !isChanOpen {
if len(userServiceLogsByUuidChan) == 0 {
Expand Down
5 changes: 3 additions & 2 deletions engine/server/engine/server/engine_connect_server_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,8 @@ func (service *EngineConnectServerService) GetServiceLogs(ctx context.Context, c
select {
//stream case
case serviceLogsByServiceUuid, isChanOpen := <-serviceLogsByServiceUuidChan:
//If the channel is closed means that the logs database client won't continue sending streams
// If the channel is closed means that the logs database client won't continue sending streams
// but keep reading from it until the channel is empty
if !isChanOpen && len(serviceLogsByServiceUuidChan) == 0 {
logrus.Debug("Exiting the stream loop after receiving a close signal from the service logs by service UUID channel")
return nil
Expand All @@ -359,9 +360,9 @@ func (service *EngineConnectServerService) GetServiceLogs(ctx context.Context, c
//client cancel ctx case
case <-contextWithCancel.Done():
if len(serviceLogsByServiceUuidChan) == 0 {
logrus.Debug("The user service logs stream has done")
return nil
}
logrus.Debug("The user service logs stream has done")
//error from logs database case
case err, isChanOpen := <-errChan:
if isChanOpen {
Expand Down

0 comments on commit f868ae9

Please sign in to comment.