Skip to content

Commit d088849

Browse files
committed
Update messaging related to the collector running behind.
1 parent 9748124 commit d088849

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

lib/App/Yath/Options/Collector.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use App::Yath::Options;
99
option_group {prefix => 'collector', category => "Collector Options"} => sub {
1010
option max_open_jobs => (
1111
type => 's',
12-
description => 'Maximum number of jobs a collector can process at a time, if more jobs are pending their output will be delayed until the earlier jobs have been processed. (Default: 300)',
12+
description => 'Maximum number of jobs a collector can process at a time. If more jobs are pending, their output will be delayed until the earlier jobs have been processed. Note that each job needs roughly 2 file descriptors and the standard UNIX process only has access to 1024 descriptors. Exceeding file descriptors will crash this process. You can find your max file handles by running "ulimit -n" (Default: 300)',
1313
default => 300,
1414
long_examples => [' 300'],
1515
short_examples => [' 300'],

lib/Test2/Harness/Collector.pm

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,15 +230,15 @@ sub send_backed_up {
230230
* Testing will continue, but some tests may be running or even complete before they are rendered.
231231
* All tests and events will eventually be displayed, and your final results will not be effected.
232232
233-
Set a higher --max-open-jobs collector setting to prevent this problem in the
234-
future, but be advised that could result in too many open filehandles on some
235-
systems.
233+
You may have set '-jX' too high. This can cause the system load to slow down the processing of
234+
results. It is also possible to set a higher '--max-open-jobs' collector setting, but be advised
235+
that could result in the run crashing due too many open filehandles.
236236
237237
This message will only be shown once.
238238
EOT
239239

240240
$self->{+ACTION}->($e);
241-
return;
241+
return 0;
242242
}
243243

244244
sub jobs {
@@ -308,8 +308,11 @@ sub jobs {
308308
);
309309
}
310310

311-
# The collector didn't read in all the jobs because it'd run out of file handles. We need to let the stream know we're behind.
312-
$self->send_backed_up if $max_open_jobs <= keys %$jobs;
311+
# The collector didn't read in all the jobs because it'd run out of file handles. We need to let the harness output know we're behind.
312+
if( $max_open_jobs <= scalar keys %$jobs ) {
313+
my $msg = "The Yath Collector is running behind. More than $max_open_jobs test results have not been processed.";
314+
$self->send_backed_up or $self->{+ACTION}->( $self->_harness_event(0, undef, time, info => [{details => $msg, tag => "INTERNAL", debug => 1, important => 1}]) );
315+
}
313316

314317
return $jobs;
315318
}

0 commit comments

Comments
 (0)