From 735b4e0fc027f7e8a66640fe11174f709131160f Mon Sep 17 00:00:00 2001 From: Mason James Date: Fri, 16 Jun 2017 01:20:05 +1200 Subject: [PATCH] Bug 18055: Speed up '00-strict.t' test, with Parallel::ForkManager add KOHA_PROVE_CPUS envar to manually set number of cpus to test.. 1/ set number of cpus to 1 $ export KOHA_PROVE_CPUS=1 2/ observe 1 cpus are used $ time prove -v t/db_dependent/00-strict.t t/db_dependent/00-strict.t .. Using 1 CPUs... 3/ unset number of cpus $ export KOHA_PROVE_CPUS= 4/ observe all available cpus are used $ time prove -v t/db_dependent/00-strict.t t/db_dependent/00-strict.t .. Using 32 CPUs... Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart --- t/db_dependent/00-strict.t | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/00-strict.t b/t/db_dependent/00-strict.t index 4aa0a0cb26..131c76d048 100755 --- a/t/db_dependent/00-strict.t +++ b/t/db_dependent/00-strict.t @@ -39,12 +39,14 @@ $Test::Strict::TEST_STRICT = 0; $Test::Strict::TEST_SKIP = [ 'misc/kohalib.pl', 'misc/plack/koha.psgi' ]; my $ncpu; -if ( $ENV{KOHA_JENKINS} ) { - $ncpu = 2; # works fastest on kc.org jenkins box +if ( $ENV{KOHA_PROVE_CPUS} ) { + $ncpu = $ENV{KOHA_PROVE_CPUS} ; # set number of cpus to use } else { $ncpu = Sys::CPU::cpu_count(); } +print "Using $ncpu CPUs...\n"; + my $pm = new Parallel::ForkManager($ncpu); foreach my $d (@dirs) { -- 2.39.5