cpan-testers / CPAN-Reporter-Smoker

(Perl) Turnkey CPAN Testers smoking
http://search.cpan.org/dist/CPAN-Reporter-Smoker
5 stars 4 forks source link

Timeout causes CRS to restart even under PERL_CR_SMOKER_RUNONCE #9

Open dcollinsn opened 7 years ago

dcollinsn commented 7 years ago

I ran with the following command line:

PERL_CR_SMOKER_RUNONCE=1 install/bin/perl -MCPAN::Reporter::Smoker -e 'start(install => 1, force_trust => 1)'

And found that the smoker was still restarting every 12 hours. The following code is to blame:

  SCAN_LOOP:
  while ( 1 ) {
    # SNIP
    DIST:
    for my $d ( 0 .. $#{$dists} ) {
      # SNIP
      next SCAN_LOOP if time - $loop_start_time > $args{restart_delay}; # <-- HERE
    }
    last SCAN_LOOP if $ENV{PERL_CR_SMOKER_RUNONCE};
    # SNIP
  }

It would behave as (I) expected if the indicated line was replaced with:

next SCAN_LOOP if time - $loop_start_time > $args{restart_delay} && !$ENV{PERL_CR_SMOKER_RUNONCE};

In other words - under runonce, it currently restarts if the timeout it hit before all of CPAN is tested. The above change will prevent the erroneous restart. (I noticed this because I'm trying to smoke perl feature branches against all of CPAN, so I care about getting as deep as possible in CPAN - and restarting and retesting everything that FAILed, NAed, UNKNOWNed, or had a distroprefs'ed dependency is counterproductive.)