Skip to content

Commit d5a8af5

Browse files
committed
Log disconnection of the livehandler due to file changes
https://progress.opensuse.org/issues/187014 Signed-off-by: Ioannis Bonatakis <[email protected]>
1 parent e6d3f5e commit d5a8af5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/OpenQA/Shared/Controller/Running.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,9 @@ sub streamtext ($self, $file_name, $start_hook = undef, $close_hook = undef) {
113113
# Setup utility function to close the connection if something goes wrong
114114
my $timer_id;
115115
my $close_connection = sub ($self) {
116+
my $worker_id = $worker->id;
117+
log_debug "Connection to worker with ID $worker_id will be closed because $logfile changed";
116118
Mojo::IOLoop->remove($timer_id);
117-
$close_hook->();
118119
$self->finish;
119120
close $log;
120121
};

t/26-controllerrunning.t

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ subtest streaming => sub {
8888

8989
$controller->streamtext('test.txt');
9090
$t_file->remove();
91-
Mojo::IOLoop->one_tick;
91+
combined_like { Mojo::IOLoop->one_tick }
92+
qr{Connection to worker .* will be closed because /tmp/.+/test.txt changed},
93+
'connection termination is logged when log is truncated';
9294
ok $c_finished, 'controller has closed after file removed';
9395
};
9496

0 commit comments

Comments
 (0)