App-Prove-Plugin-Elasticsearch
view release on metacpan or search on metacpan
max_workers => $conf->{'testd.max_workers'},
chunk_size => 1,
};
mce_loop {
#XXX Net::Rabbitmq is doing something incorrectly, requiring us to re-import every time we fork to avoid 'connection reset by peer'
my $q_f = &{\&{$queue . "::new"}}($queue);
#Ensure we have no channel overlap with single-threaded things, like the write_channel, which testd does not use
$q->{read_channel} = 10 + MCE->wid();
MCE->say("Worker "
. MCE->wid()
. " started, checking queue on channel $q->{read_channel}");
worker($conf, $worker_state, $jobspec, $q_f);
}
1 .. $conf->{'testd.max_workers'};
$0 = "testd - master: attempting to provision to different test target";
print "All workers done. Attempting to re-provision for new work...\n";
my $result = try_to_provision(
$versioner, $q, $jobspec->{platforms},
$0 = "$msg starting up";
while (1) {
#check if every job is not busy, and if so, return so we can re-provision.
return 1 unless sum(values(%$worker_state));
$worker_state->{MCE->wid()} = 1;
$0 = "$msg looking for jobs";
my @jobs = $q->get_jobs($jobspec);
MCE->say("Found " . scalar(@jobs) . " jobs for worker " . MCE->wid());
if (!@jobs) {
$worker_state->{MCE->wid()} = 0;
$0 = "$msg waiting for jobs";
sleep $interval;
next;
}
$0 = "$msg running tests";
my $runner = App::Prove::Elasticsearch::Utils::require_runner($conf);
&{\&{$runner . "::run"}}($conf, @jobs);
}
( run in 1.377 second using v1.01-cache-2.11-cpan-d7a12ab2c7f )