You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Fred Moyer <fr...@taperfriendlymusic.org> on 2007/12/26 04:16:48 UTC

[Fwd: svn commit: r606831 - in /perl/modperl/trunk/t: apr/pool_lifetime.t response/TestAPR/pool_lifetime.pm]

Gozer, I've refactored everything to use keep alives instead of sameinterp
per your example and our discussion at ApacheCon.  I haven't tested to see
if it sped up running the test suite, but it should in theory since less
attempts will be made to locate the correct interpreter.

There is still t/modperl/sameinterp.t and
t/response/TestModperl/sameinterp.pm to implement the actual sameinterp
mechanism.  Should I remove those, or is there some part of it we need
that keep_alives doesn't do?

- Fred

---------------------------- Original Message ----------------------------
Subject: svn commit: r606831 - in /perl/modperl/trunk/t:
apr/pool_lifetime.t response/TestAPR/pool_lifetime.pm From:   
phred@apache.org
Date:    Tue, December 25, 2007 6:50 pm
To:      modperl-cvs@perl.apache.org
--------------------------------------------------------------------------

Author: phred
Date: Tue Dec 25 18:50:29 2007
New Revision: 606831

URL: http://svn.apache.org/viewvc?rev=606831&view=rev
Log:
Refactor to use keep_alives instead of TestCommon::SameInterp.
As done originally in revision 594682 at ApacheCon 2007

Modified:
    perl/modperl/trunk/t/apr/pool_lifetime.t
    perl/modperl/trunk/t/response/TestAPR/pool_lifetime.pm

Modified: perl/modperl/trunk/t/apr/pool_lifetime.t
URL:
http://svn.apache.org/viewvc/perl/modperl/trunk/t/apr/pool_lifetime.t?rev=606831&r1=606830&r2=606831&view=diff
==============================================================================
--- perl/modperl/trunk/t/apr/pool_lifetime.t (original)
+++ perl/modperl/trunk/t/apr/pool_lifetime.t Tue Dec 25 18:50:29 2007 @@
-4,7 +4,7 @@
 use Apache::Test;
 use Apache::TestUtil;
 use Apache::TestRequest;
-use TestCommon::SameInterp;
+Apache::TestRequest::user_agent(keep_alive => 1);

 plan tests => 2, need 'HTML::HeadParser';

@@ -12,18 +12,14 @@
 my $location = '/' . Apache::TestRequest::module2path($module);

 t_debug "getting the same interp ID for $location";
-my $same_interp = Apache::TestRequest::same_interp_tie($location); -
-my $skip = $same_interp ? 0 : 1;

 for (1..2) {
     my $expected = "Pong";
-    my $received = same_interp_req_body($same_interp, \&GET, $location);
-    $skip++ unless defined $received;
-    same_interp_skip_not_found(
-        $skip,
+    my $received = GET "$location";
+
+    ok t_cmp(
+        $received->content,
         $expected,
-        $received,
-        "Pong"
+        "Pong",
     );
 }

Modified: perl/modperl/trunk/t/response/TestAPR/pool_lifetime.pm
URL:
http://svn.apache.org/viewvc/perl/modperl/trunk/t/response/TestAPR/pool_lifetime.pm?rev=606831&r1=606830&r2=606831&view=diff
==============================================================================
--- perl/modperl/trunk/t/response/TestAPR/pool_lifetime.pm (original) +++
perl/modperl/trunk/t/response/TestAPR/pool_lifetime.pm Tue Dec 25 18:50:29
2007 @@ -23,5 +23,3 @@
 }

 1;
-__END__
-PerlFixupHandler Apache::TestHandler::same_interp_fixup






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


Re: [Fwd: svn commit: r606831 - in /perl/modperl/trunk/t: apr/pool_lifetime.t response/TestAPR/pool_lifetime.pm]

Posted by "Philippe M. Chiasson" <go...@apache.org>.
Fred Moyer wrote:
> Gozer, I've refactored everything to use keep alives instead of sameinterp
> per your example and our discussion at ApacheCon. 

Cool! I saw the commits, but haven't had the chance of testing them.

> I haven't tested to see
> if it sped up running the test suite, but it should in theory since less
> attempts will be made to locate the correct interpreter.

And it also removes the non-deterministic aspect of these tests. With the
old model, they could sometimes fail to locate the correct interp and effectively
not run that particular test.

This way is good, IMO, even if things are not any faster, they are more
correct.

> There is still t/modperl/sameinterp.t and
> t/response/TestModperl/sameinterp.pm to implement the actual sameinterp
> mechanism.  Should I remove those, or is there some part of it we need
> that keep_alives doesn't do?

If there are no tests left that need them, I'd nuke them. We can always
bring them back from the dead if we have a need for it in the future.

-- 
Philippe M. Chiasson     GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/       m/gozer\@(apache|cpan|ectoplasm)\.org/