You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Steve Hay <st...@uk.radan.com> on 2004/05/25 11:25:05 UTC

[PATCH] Re: t/SMOKE not working properly? [was Re: apr/pool makes compat/send_fd & driective/setupenv fail on Win32]

Stas Bekman wrote:

>Steve Hay wrote:
>[...]
>  
>
>>>That what t/SMOKE is for. It does the job of finding such sequences for you.
>>>
>>>      
>>>
>>I'd forgotten about that, but now that I come to try it (to see if it 
>>finds the correct result, now that I know what the correct result is 
>>:-), it seems to not work properly.
>>    
>>
>
>I have never tried running it on windows, it's quite possible that it doesn't 
>work there. But I remember that Randy was successful running it. That's why we 
>changed it to use IPC::Run. If we can fix it that would be good.
>
I remember the IPC::Run3 stuff myself; it definitely *did* do something 
useful on Win32 at the time.

>
>  
>
>>I know that the failure sequence lies in apr/ and compat/ so I ran "perl 
>>t/SMOKE apr compat".
>>
>>The first time I tried it did this:
>>
>>=====
>>[warning] Using random number seed: 1148777795 (autogenerated)
>>[   info] Report file: 
>>C:\Temp\mod_perl-1.99_14\smoke-report-Tue_May_25_08-59-19_2004.txt
>>[warning]
>>------------------------------------------------------------
>>[warning] [001-00-00] trying all tests 10 times
>>[  error] recorded a positive failure ('t\compat/conn_authen.t'), will 
>>try to minimize the input now
>>[warning] [001-01-01] trying 't\compat/conn_authen.t' on its own
>>iteration 1 (1 tests):
>>        C:\apache2\perl5\bin\perl.exe C:/Temp/mod_perl-1.99_14/t/TEST 
>>t\compat/conn_authen.t
>>(made 1 successful reductions)
>>=====
>>
>>What does "positive failure" mean?  Why does it stop there? - does it 
>>think there is a problem with compat/conn_authen?  
>>    
>>
>
>The logic is explained in the module's docs. If it finds a test that fails on 
>its own, there is no point to run smoke, since it'll always fails on that 
>test. So it doesn't to make your CPU's life shorter.
>
Right, so it's thinking that a test failed when it (almost certainly) 
didn't.

>
>  
>
>>There doesn't seem to 
>>be when I run it manually, even running it after apr/pool.
>>
>>I tried another two times and the output each time was exactly as above, 
>>except that it picked a different test each time to complain about -- 
>>compat/request_body then compat/request, neither of which seem to have 
>>any trouble that I'm aware of either.
>>    
>>
>
>Perhaps on windows it thinks that a test fails when it doesn't. It just parses 
>the output of Test::Harness and looks for 'ok' and fails otherwise. You can run:
>
>   t/SMOKE -v ...
>
>to get the verbose output of what it does. (it's different from -v in the 
>t/TEST land).
>
Ah, yes - it's all coming back to me now.  I haven't tried this for a 
while.  Here's some typical output with -v:

=====
C:\Temp\modperl-2.0>perl t/SMOKE -v apr compat
[warning] Using random number seed: 1178930015 (autogenerated)
[   info] Report file: 
C:\Temp\modperl-2.0\smoke-report-Tue_May_25_09-41-23_2004.txt
[warning]
------------------------------------------------------------
[warning] [001-00-00] trying all tests 10 times
t\compat/apache........FAILED
[  error] ------------------------------------------------------------
[  error]               *** run log ***
    [  error] unknown opts or test names: t\compat/apache.t
    -help will list options


[  error] ------------------------------------------------------------
[  error] recorded a positive failure ('t\compat/apache.t'), will try to 
minimize the input now
[warning] [001-01-01] trying 't\compat/apache.t' on its own
t\compat/apache..FAILED
[  error] ------------------------------------------------------------
[  error]               *** run log ***
    [  error] unknown opts or test names: t\compat/apache.t
    -help will list options


[  error] ------------------------------------------------------------
iteration 1 (1 tests):
        C:\apache2\perl5\bin\perl.exe C:/Temp/modperl-2.0/t/TEST 
-verbose t\compat/apache.t
(made 1 successful reductions)
=====

So it appears to not even try the test because it doesn't like the test 
name argument "t\compat/apache.t".  This is quite reproducible: "perl 
t/TEST t\compat/apache.t" produces the same complaint as seen above.

I guess the mess of backslashes and forward slashes should really be 
cleaned up, but t/TEST should also probably be tolerant of it, just in 
case -- perl.exe itself is quite happy when given such a path.

I've had a look at Apache::TestRun::split_test_args().

When running "perl t/TEST t/compat/apache.t", the line

        $arg =~ s@^(?:\./)?t/@@;

removes the leading "t/" so that the $file which is subsequently tested 
for is "C:\Temp\modperl-2.0\t\compat\apache.t" (catfile runs its return 
values through canonpath, hence the /'s have become \'s), which is 
correctly identified as a test and added to @tests.

But when running "perl t/TEST t\compat/apache.t" the above s/// fails to 
remove the leading "t\".  The $file tested for is then 
"C:\Temp\modperl-2.0\t\t\compat\apache.t", which doesn't exist, so 
nothing gets added to @tests, and the t\compat/apache.t argument gets 
thrown into @leftovers instead.

The attached patch allows for t\ and .\t\ at the start of the test name, 
and also makes sure that the paths finally placed in $self->{tests} are 
nicely cleaned up.

With this patch in place, t/SMOKE now works a treat:

=====
[warning] [001-00-00] trying all tests 10 times
[  error] recorded a positive failure ('t\compat\send_fd.t'), will try 
to minimize the input now
[warning] [001-01-01] trying 't\compat\send_fd.t' on its own
[warning]
[001-02-01] trying 12 tests
[  error] *** reduction 2 succeeded (12 tests) ***
[warning]
[001-03-01] trying 6 tests
[warning]
[001-03-02] trying 6 tests
[  error] *** reduction 3 succeeded (6 tests) ***
[warning]
[001-04-01] trying 3 tests
[warning]
[001-04-02] trying 3 tests
[  error] *** reduction 4 succeeded (3 tests) ***
[warning]
[001-05-01] trying 2 tests
[  error] *** reduction 5 succeeded (2 tests) ***
[warning]
[001-06-01] trying 1 tests
[warning]
[001-06-02] trying 1 tests
[  error] *** reduction 6 succeeded (1 tests) ***
iteration 1 (2 tests):
        C:\apache2\perl5\bin\perl.exe C:/Temp/modperl-2.0/t/TEST 
t\apr\pool.t t\compat\send_fd.t
(made 6 successful reductions)
=====

- Steve


------------------------------------------------
Radan Computational Ltd.

The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only.  If you have received this message in error or there are any problems, please notify the sender immediately.  The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden.  Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd.  The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email.

Re: [PATCH] Re: t/SMOKE not working properly? [was Re: apr/pool makes compat/send_fd & driective/setupenv fail on Win32]

Posted by Stas Bekman <st...@stason.org>.
Steve Hay wrote:
[...]
> With this patch in place, t/SMOKE now works a treat:
> 
> =====
> [warning] [001-00-00] trying all tests 10 times
> [  error] recorded a positive failure ('t\compat\send_fd.t'), will try 
> to minimize the input now
> [warning] [001-01-01] trying 't\compat\send_fd.t' on its own
> [warning]
> [001-02-01] trying 12 tests
> [  error] *** reduction 2 succeeded (12 tests) ***
> [warning]
> [001-03-01] trying 6 tests
> [warning]
> [001-03-02] trying 6 tests
> [  error] *** reduction 3 succeeded (6 tests) ***
> [warning]
> [001-04-01] trying 3 tests
> [warning]
> [001-04-02] trying 3 tests
> [  error] *** reduction 4 succeeded (3 tests) ***
> [warning]
> [001-05-01] trying 2 tests
> [  error] *** reduction 5 succeeded (2 tests) ***
> [warning]
> [001-06-01] trying 1 tests
> [warning]
> [001-06-02] trying 1 tests
> [  error] *** reduction 6 succeeded (1 tests) ***
> iteration 1 (2 tests):
>         C:\apache2\perl5\bin\perl.exe C:/Temp/modperl-2.0/t/TEST 
> t\apr\pool.t t\compat\send_fd.t
> (made 6 successful reductions)

Nice :)

Thanks for the research and the patch, Steve, no committed!

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org