On 08/30/2012 06:56 PM, Eric Wilhelm wrote:
> # from Mark Stosberg on Thursday 30 August 2012:
>> I suspect there's a bug that works as follows, but I haven't isolated
>> it yet. Here's my suspected trigger:
>>
>> - First start some tests that are parallel ready, but some of them are
>> slow. - Next in the schedule have some tests which much be run in
>> sequence.
>>
>> I think the "sequence" tests are in fact being run in sequence, but
>> some of the "slow" parallel tests are still running.
> 
> Is that a bug?  I thought sequenced tests were only excluded from 
> running in parallel with each other -- and that parallel tests were 
> compatible running alongside all others.

Eric,

Thanks for the follow-up. I think you are right... I think that answer
means there is no way to use the "--rules" flags to 'prove' to
accomplish what I want, as it is written

I looked into the App/Prove.pm source code and immediately spotted the
issue. It hardcodes that all "rules" should run in parallel. Thus, there
would be no way to specify that something should never be run in
parallel with anything else.

I patched prove using the below patch, and my tests ran almost as I
wanted. Using the "--rules" I specified, the exceptions were all run
first, one at a time, and then the rest of the tests were run in parallel.

However, this triggered a related issue that I had seen sometimes before
in my testing-- No summary output is produced! I just see an "ok" result
line printed for the last test, and that's it. I'm not sure what's going
on there.

What could use TAP::Harness to fail to produce the summary report?

   Mark


# Alter the logic of the --rules processing for prove, so that each rule
is considered in sequence.
# This is what you want if you want to specify some exceptions with 'seq'
# that can't run in parallel.
--- old-trunk/perllib/App/Prove.pm      2012-08-31 15:01:57.000000000 -0400
+++ new-trunk/perllib/App/Prove.pm      2012-08-31 15:01:58.000000000 -0400
@@ -373,13 +373,13 @@
         my @rules;
         for ( @{ $self->rules } ) {
             if (/^par=(.*)/) {
-                push @rules, $1;
+                push @rules, { par => $1};
             }
             elsif (/^seq=(.*)/) {
                 push @rules, { seq => $1 };
             }
         }
-        $args{rules} = { par => [@rules] };
+        $args{rules} = { seq => [@rules] };
     }

     return ( \%args, $self->{harness_class} );


Reply via email to