Change 34192 by [EMAIL PROTECTED] on 2008/08/09 20:11:55
Use App::Prove::State to store the timings for the tests, and if
timings are available, reorder the parallelisable tests to run the
slowest first. Timings for a second run are 18 seconds less for me:
Files=1553, Tests=209393, 459 wallclock secs (94.89 usr 13.16 sys +
638.19 cusr 58.59 csys = 804.83 CPU)
Files=1553, Tests=209393, 441 wallclock secs (82.83 usr 13.90 sys +
622.13 cusr 59.20 csys = 778.06 CPU)
Affected files ...
... //depot/perl/Makefile.SH#405 edit
... //depot/perl/t/harness#52 edit
... //depot/perl/vms/descrip_mms.template#145 edit
... //depot/perl/win32/Makefile#353 edit
... //depot/perl/win32/Makefile.ce#17 edit
... //depot/perl/win32/makefile.mk#393 edit
Differences ...
==== //depot/perl/Makefile.SH#405 (text) ====
Index: perl/Makefile.SH
--- perl/Makefile.SH#404~33757~ 2008-04-27 03:13:49.000000000 -0700
+++ perl/Makefile.SH 2008-08-09 13:11:55.000000000 -0700
@@ -1098,6 +1098,7 @@
_clobber:
[EMAIL PROTECTED] -f Cross/run-* Cross/to-* Cross/from-*
+ rm -f t/test_state
rm -f config.sh cppstdin Policy.sh extras.lst
clobber: cleanup_unpacked_files _realcleaner _mopup _clobber
==== //depot/perl/t/harness#52 (text) ====
Index: perl/t/harness
--- perl/t/harness#51~34191~ 2008-08-09 06:16:03.000000000 -0700
+++ perl/t/harness 2008-08-09 13:11:55.000000000 -0700
@@ -46,7 +46,7 @@
unlink "$_.t";
}
-my (@tests, $rules, $re);
+my (@tests, $re);
# [.VMS]TEST.COM calls harness with empty arguments, so clean-up @ARGV
@ARGV = grep $_ && length( $_ ) => @ARGV;
@@ -100,7 +100,11 @@
}
}
+my $jobs = $ENV{TEST_JOBS};
+my ($rules, $state);
+
if (@ARGV) {
+ # If you want these run in speed order, just use prove
if ($^O eq 'MSWin32') {
@tests = map(glob($_),@ARGV);
}
@@ -123,15 +127,35 @@
# nice to get the tests in t/op/*.t able to run in parallel.
unless (@tests) {
- my @seq;
- push @seq, <base/*.t>;
+ my @seq = <base/*.t>;
my @next = qw(comp cmd run io op uni mro lib);
push @next, 'japh' if $torture;
push @next, 'win32' if $^O eq 'MSWin32';
- push @seq, { par => [
+ # Hopefully TAP::Parser::Scheduler will support this syntax soon.
+ # my $next = { par => '{' . join (',', @next) . '}/*.t' };
+ my $next = { par => [
map { "$_/*.t" } @next
] };
+ @tests = _extract_tests ($next);
+
+ # This is a bit of a game, because we only want to sort these tests in
+ # speed order. base/*.t wants to run first, and ext,lib etc last and in
+ # MANIFEST order
+ if ($jobs) {
+ require App::Prove::State;
+ $state = App::Prove::State->new({ store => 'test_state' });
+ $state->apply_switch('slow', 'save');
+ # For some reason get_tests returns *all* the tests previously run,
+ # (in the right order), not simply the selection in @tests
+ # (in the right order). Not sure if this is a bug or a feature.
+ # Whatever, *we* are only interested in the ones that are in @tests
+ my %seen;
+ @[EMAIL PROTECTED] = ();
+ @tests = grep {exists $seen{$_} } $state->get_tests(0, @tests);
+ }
+ @tests = (@seq, @tests);
+ push @seq, $next;
my @last;
use Config;
@@ -171,12 +195,11 @@
push @last, <pod/*.t>;
push @last, <x2p/*.t>;
- @tests = (_extract_tests (@seq), @last);
+ push @tests, @last;
push @seq, _seq_dir_rules @last;
$rules = { seq => [EMAIL PROTECTED] };
-
}
}
if ($^O eq 'MSWin32') {
@@ -185,10 +208,16 @@
@tests=grep /$re/, @tests
if $re;
-my $jobs = $ENV{TEST_JOBS};
if ($jobs) {
eval 'use TAP::Harness 3.13; 1' or die $@;
my $h = TAP::Harness->new({ jobs => $jobs, rules => $rules});
+ if ($state) {
+ $h->callback(
+ after_test => sub {
+ $state->observe_test(@_);
+ }
+ );
+ }
$h->runtests(@tests);
} else {
Test::Harness::runtests @tests;
==== //depot/perl/vms/descrip_mms.template#145 (text) ====
Index: perl/vms/descrip_mms.template
--- perl/vms/descrip_mms.template#144~33971~ 2008-05-31 11:48:38.000000000
-0700
+++ perl/vms/descrip_mms.template 2008-08-09 13:11:55.000000000 -0700
@@ -1865,6 +1865,7 @@
- If F$Search("[...]*$(E)").nes."" Then Delete/NoConfirm/Log
[...]*$(E);*
- If F$Search("[.vms]Perl_Setup.Com").nes."" Then Delete/NoConfirm/Log
[.vms]Perl_Setup.Com;*
- If F$Search("[.t]rantests.").nes."" Then Delete/NoConfirm/Log
[.t]rantests.;*
+ - If F$Search("[.t]test_state.").nes."" Then Delete/NoConfirm/Log
[.t]test_state.;*
- If F$Search("[.t.lib]vmsfspec.t").nes."" Then Delete/NoConfirm/Log
[.t.lib]vmsfspec.t;*
- If F$Search("[.t.lib]vmsish.t").nes."" Then Delete/NoConfirm/Log
[.t.lib]vmsish.t;*
- If F$Search("[.t.lib]vms_dclsym.t").nes."" Then Delete/NoConfirm/Log
[.t.lib]vms_dclsym.t;*
==== //depot/perl/win32/Makefile#353 (text) ====
Index: perl/win32/Makefile
--- perl/win32/Makefile#352~33349~ 2008-02-22 10:10:36.000000000 -0800
+++ perl/win32/Makefile 2008-08-09 13:11:55.000000000 -0700
@@ -1225,6 +1225,7 @@
-if exist pod2htmd.tmp del pod2htmd.tmp
-if exist pod2htmi.tmp del pod2htmi.tmp
-if exist $(HTMLDIR) rmdir /s /q $(HTMLDIR)
+ -del /f ..\t\test_state
install : all installbare installhtml
==== //depot/perl/win32/Makefile.ce#17 (text) ====
Index: perl/win32/Makefile.ce
--- perl/win32/Makefile.ce#16~32646~ 2007-12-19 05:48:45.000000000 -0800
+++ perl/win32/Makefile.ce 2008-08-09 13:11:55.000000000 -0700
@@ -779,6 +779,7 @@
-rm -f $(MACHINE)/*.lib
-rm -f ../config.sh ../lib/Config.pm
-rm -f config.h xconfig.h perl.res
+ -rm -f ../t/test_state
XDLLOBJS = \
$(DLLDIR)\av.obj \
==== //depot/perl/win32/makefile.mk#393 (text) ====
Index: perl/win32/makefile.mk
--- perl/win32/makefile.mk#392~33349~ 2008-02-22 10:10:36.000000000 -0800
+++ perl/win32/makefile.mk 2008-08-09 13:11:55.000000000 -0700
@@ -1549,6 +1549,7 @@
-if exist pod2htmd.tmp del pod2htmd.tmp
-if exist pod2htmi.tmp del pod2htmi.tmp
-if exist $(HTMLDIR) rmdir /s /q $(HTMLDIR)
+ -del /f ..\t\test_state
install : all installbare installhtml
End of Patch.