Subject: | interaction of rules and test order |
I was hoping that I could get the core tests running in parallel,
slowest first. So I tried this patch to t/harness
==== //depot/perl/t/harness#50 - /Volumes/Stuff/p4perl/perl/t/harness ====
--- /tmp/tmp.25985.99 2008-08-09 12:46:23.000000000 +0100
+++ /Volumes/Stuff/p4perl/perl/t/harness 2008-08-09
12:46:13.000000000 +0100
@@ -188,8 +188,16 @@ if ($^O eq 'MSWin32') {
my $jobs = $ENV{TEST_JOBS};
if ($jobs) {
eval 'use TAP::Harness 3.13; 1' or die $@;
+ require App::Prove::State;
my $h = TAP::Harness->new({ jobs => $jobs, rules => $rules});
- $h->runtests(@tests);
+ my $s = App::Prove::State->new({ store => 'test_state' });
+ $s->apply_switch('slow', 'save');
+ $h->callback(
+ after_test => sub {
+ $s->observe_test(@_);
+ }
+ );
+ $h->runtests($s->get_tests(0, @tests));
} else {
Test::Harness::runtests @tests;
}
First time through I got the message about no saved state, and at the
end of the first run, I got the state written out.
Second run, expectations high, but I see that tests continue to run in
the same order as before. :-(
In particular, op/regexp_qr_embed_thr.t is still the last test to finish
of the first batch in parallel. I printed out the output of
App::Prove::State::get_tests - here are the top ten:
../ext/Compress/Raw/Zlib/t/07bufsize.t
op/regexp_qr_embed_thr.t
../ext/B/t/concise-xs.t
../lib/locale.t
op/pat.t
op/pat_thr.t
../ext/Time/HiRes/t/HiRes.t
../lib/Benchmark.t
../ext/IO_Compress_Zlib/t/106prime-zip.t
../lib/Memoize/t/expmod_t.t
../lib/Module/Build/t/compat.t
../ext/IO/t/io_sock.t
../lib/File/Temp/t/fork.t
../lib/Memoize/t/speed.t
../ext/threads/shared/t/wait.t
../lib/AutoLoader/t/02AutoSplit.t
../lib/Thread/Queue/t/01_basic.t
../lib/ExtUtils/t/Constant.t
../ext/threads/t/free.t
So I know that the state file is being written out correctly, and with
good data. So how easy (or hard) is it to merge the order of the passed
in tests with the constraints of the ruleset, and hence run the slowest
available test within parallel groups?
Nicholas Clark