Skip Menu |

This queue is for tickets about the Apache-Test CPAN distribution.

Report information
The Basics
Id: 12911
Status: resolved
Priority: 0/
Queue: Apache-Test

People
Owner: Nobody in particular
Requestors: rt [...] corion.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: Apache::Test Makefile.PL enters infinite loop when run unattended
The Makefile.PL for Apache::Test enters an infinite loop when it is run unattended and cannot find the "httpd" executable. This should not be done. What should be done is detect that Makefile.PL runs unattended, and then ask once and bail out. Please fix that, as it constantly breaks my cpan smoking.
Refreshing the ticket. Behavior is still present in 1.30. Please break the potentially endless loop. I don't know what shall follow after the loop is broken, otherwise I would provide a patch. Regards,
On Mon Jul 28 18:01:44 2008, ANDK wrote: Show quoted text
> Refreshing the ticket. Behavior is still present in 1.30. > > Please break the potentially endless loop. I don't know what shall > follow after the loop is broken, otherwise I would provide a patch.
Can you give me a few more details? When starting with a clean environment, here is what I see: phred@pooky ~/dev/svn/modperl/mod_perl-2.0 $ perl Makefile.PL no conflicting prior mod_perl version found - good. Next we need to know where the 'apxs' script is located. This script provides a lot of information about the Apache installation, and makes it easier to find things on your system. Normally it's located in the same directory as the 'httpd' executable. If you don't yet have Apache installed you can build Apache against the Apache source code, but you won't be able to run the test suite (a very important step). Therefore you may want to install Apache before proceeding. Please provide a full path to 'apxs' executable (press Enter if you don't have it installed): Are you saying that this just loops endlessly?
Subject: Re: [rt.cpan.org #12911] Apache::Test Makefile.PL enters infinite loop when run unattended
Date: Sat, 18 Apr 2009 10:47:05 +0200
To: bug-Apache-Test [...] rt.cpan.org
From: Max Maischein <corion [...] corion.net>
Hello, Show quoted text
> If you don't yet have Apache installed you can build Apache against > the Apache source code, but you won't be able to run the test suite (a > very important step). Therefore you may want to install Apache before > proceeding.
I am (resp. was) running a unattended CPAN smoke tester without Apache. Show quoted text
> Please provide a full path to 'apxs' executable > (press Enter if you don't have it installed): > > > Are you saying that this just loops endlessly?
Yes: lib/Apache/TestConfig.pm sub _custom_config_prompt_path { my($wanted, $rh_choices, $optional) = @_; my $ans; my $default = ''; my $optional_str = $optional ? " (optional)" : ''; my $prompt = "\nPlease provide a full path to$optional_str '$wanted' executable"; my @choices = (); if (%$rh_choices) { $prompt .= " or choose from the following options:\n\n"; my $c = 0; for (sort keys %$rh_choices) { $c++; $prompt .= " [$c] $_\n"; push @choices, $_; } $prompt .= " \n"; $default = 1; # a wild guess } else { $prompt .= ":\n\n"; } while (1) { $ans = ExtUtils::MakeMaker::prompt($prompt, $default); # strip leading/closing spaces $ans =~ s/^\s*|\s*$//g; # convert the item number to the path if ($ans =~ /^(\d+)$/) { if ($1 > 0 and $choices[$1-1]) { $ans = $choices[$1-1]; } else { warn "The choice '$ans' doesn't exist\n"; next; } } ... This will never stop even if there is no terminal connected. ExtUtils::MakeMaker::prompt knows to do the correct thing and does just return the default when the script is run unattended. The routine should either detect that it is run unattended and skip the question or have a bailout after (say) 10 identically answered but unsatisfactory answers, or it should just ask once, insteqad of diving into a potentially infinite loop unattended. Thanks for looking after this, -max
This is resolved as of r766280 in Apache::Test 1.31-dev. Been working on this version so 1.31 should be released 'soonish'. Index: lib/Apache/TestConfig.pm =================================================================== --- lib/Apache/TestConfig.pm (revision 766267) +++ lib/Apache/TestConfig.pm (working copy) @@ -2406,7 +2406,18 @@ $prompt .= ":\n\n"; } + my $i = 0; while (1) { + + # prevent infinite loops in smoke tests, only give the user + # five chances to specify httpd or apxs before giving up + if ($i++ == 5) { + + Apache::TestRun::skip_test_suite('y'); + return; + } + + $ans = ExtUtils::MakeMaker::prompt($prompt, $default);