[Rt-commit] rt branch, 4.0/mod-perl-failure, created. rt-4.0.1rc1-9-gbf11644

? sunnavy sunnavy at bestpractical.com
Fri Jun 3 05:24:11 EDT 2011


The branch, 4.0/mod-perl-failure has been created
        at  bf116448d3a9b41be0d7e6466f13044943360ade (commit)

- Log -----------------------------------------------------------------
commit f763c9e9b8a58aba112215d299d27d9485f34c3a
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Jun 3 16:25:29 2011 +0800

    todo timezone issues with mod_perl+worker or mod_perl+event

diff --git a/lib/RT/Test/Apache.pm b/lib/RT/Test/Apache.pm
index 6a4acd9..4683134 100644
--- a/lib/RT/Test/Apache.pm
+++ b/lib/RT/Test/Apache.pm
@@ -201,6 +201,15 @@ sub find_apache_server {
     return undef;
 }
 
+sub apache_mpm_type {
+    my $self = shift;
+    my $apache = $self->find_apache_server;
+    my $out = `$apache -l`;
+    if ( $out =~ /^\s*(worker|prefork|event|itk)\.c\s*$/m ) {
+        return $1;
+    }
+}
+
 sub fork_exec {
     my $self = shift;
 
diff --git a/t/web/cf_datetime.t b/t/web/cf_datetime.t
index 73d99c4..5abb208 100644
--- a/t/web/cf_datetime.t
+++ b/t/web/cf_datetime.t
@@ -3,12 +3,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => undef;
-
-plan skip_all => 'test with apache+mod_perl has a bug with timezones'
-    if ($ENV{RT_TEST_WEB_HANDLER}||'') =~ /^apache(\+mod_perl)?$/;
-
-plan tests => 51;
+use RT::Test tests => 51;
 
 RT->Config->Set( 'Timezone' => 'EST5EDT' ); # -04:00
 my ($baseurl, $m) = RT::Test->started_ok;
@@ -18,6 +13,15 @@ ok( $root->Load('root'), 'load root user' );
 
 my $cf_name = 'test cf datetime';
 
+my $why;
+
+if ( ( $ENV{RT_TEST_WEB_HANDLER} || '' ) =~ /^apache(\+mod_perl)?$/
+    && RT::Test::Apache->apache_mpm_type =~ /^(?:worker|event)$/ )
+{
+    $why =
+'localizing $ENV{TZ} does *not* work with mod_perl+mpm_event or mod_perl+mpm_worker';
+}
+
 my $cfid;
 diag "Create a CF";
 {
@@ -77,11 +81,14 @@ diag 'check valid inputs with various timezones in ticket create page';
 
     $ticket = RT::Ticket->new( RT->SystemUser );
     $ticket->Load($id);
-    is(
-        $ticket->CustomFieldValues($cfid)->First->Content,
-        '2010-05-04 17:00:01',
-        'date in db is in UTC'
-    );
+    TODO: {
+        local $TODO = $why;
+        is(
+            $ticket->CustomFieldValues($cfid)->First->Content,
+            '2010-05-04 17:00:01',
+            'date in db is in UTC'
+        );
+    }
 
     $m->content_contains('test cf datetime:', 'has cf datetime field on the page');
     $m->content_contains('Tue May 04 13:00:01 2010', 'has cf datetime value on the page');
@@ -89,7 +96,12 @@ diag 'check valid inputs with various timezones in ticket create page';
     $root->SetTimezone( 'Asia/Shanghai' );
     # interesting that $m->reload doesn't work
     $m->get_ok( $m->uri );
-    $m->content_contains('Wed May 05 01:00:01 2010', 'cf datetime value respects user timezone');
+
+    TODO: {
+        local $TODO = $why;
+        $m->content_contains( 'Wed May 05 01:00:01 2010',
+            'cf datetime value respects user timezone' );
+    }
 
     $m->submit_form(
         form_name => "CreateTicketInQueue",
@@ -107,17 +119,29 @@ diag 'check valid inputs with various timezones in ticket create page';
         "created ticket $id" );
     $ticket = RT::Ticket->new( RT->SystemUser );
     $ticket->Load($id);
-    is(
-        $ticket->CustomFieldValues($cfid)->First->Content,
-        '2010-05-05 23:00:01',
-        'date in db is in UTC'
-    );
+    TODO: {
+        local $TODO = $why;
+        is(
+            $ticket->CustomFieldValues($cfid)->First->Content,
+            '2010-05-05 23:00:01',
+            'date in db is in UTC'
+        );
+    }
 
     $m->content_contains('test cf datetime:', 'has no cf datetime field on the page');
-    $m->content_contains('Thu May 06 07:00:01 2010', 'cf datetime input respects user timezone');
+    TODO: {
+        local $TODO = $why;
+        $m->content_contains( 'Thu May 06 07:00:01 2010',
+            'cf datetime input respects user timezone' );
+    }
     $root->SetTimezone( 'EST5EDT' ); # back to -04:00
     $m->get_ok( $m->uri );
-    $m->content_contains('Wed May 05 19:00:01 2010', 'cf datetime value respects user timezone');
+
+    TODO: {
+        local $TODO = $why;
+        $m->content_contains( 'Wed May 05 19:00:01 2010',
+            'cf datetime value respects user timezone' );
+    }
 }
 
 
@@ -154,9 +178,13 @@ diag 'check search build page';
 
     is_results_number( { $cf_op->name => '<', $cf_field->name => '2010-05-07', }, 2 );
     is_results_number( { $cf_op->name => '>', $cf_field->name => '2010-05-04', }, 2 );
+
     is_results_number( { $cf_op->name => '=', $cf_field->name => '2010-05-05', }, 1 );
     is_results_number( { $cf_op->name => '=', $cf_field->name => '2010-05-05 01:00:01', }, 1 );
-    is_results_number( { $cf_op->name => '=', $cf_field->name => '2010-05-05 02:00:01', }, 0 );
+
+    is_results_number(
+        { $cf_op->name => '=', $cf_field->name => '2010-05-05 02:00:01', }, 0 );
+
     is_results_number( { $cf_op->name => '=', $cf_field->name => '2010-05-06', }, 1 );
     is_results_number( { $cf_op->name => '=', $cf_field->name => '2010-05-06 07:00:01', }, 1 );
     is_results_number( { $cf_op->name => '=', $cf_field->name => '2010-05-06 08:00:01', }, 0 );
@@ -184,7 +212,7 @@ diag 'check invalid inputs';
     $m->content_lacks('foodate', 'invalid dates not set');
 }
 
-sub is_results_number { 
+sub is_results_number {
     local $Test::Builder::Level = $Test::Builder::Level + 1;
     my $fields = shift;
     my $number = shift;
@@ -196,7 +224,10 @@ sub is_results_number {
         fields => $fields,
         button => 'DoSearch',
     );
-    $m->content_contains( "Found $number ticket", "Found $number ticket" );
+    TODO: {
+        local $TODO = $why;
+        $m->content_contains( "Found $number ticket", "Found $number ticket" );
+    }
 }
 
 # to make $m->DESTROY happy

commit bf116448d3a9b41be0d7e6466f13044943360ade
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Jun 3 16:26:07 2011 +0800

    warn the timezone failure in doc

diff --git a/docs/web_deployment.pod b/docs/web_deployment.pod
index 2bd6d5d..9efc813 100644
--- a/docs/web_deployment.pod
+++ b/docs/web_deployment.pod
@@ -26,6 +26,9 @@ to use L<Starman>, a high performance preforking server:
 
 B<WARNING: mod_perl 1.99_xx is not supported.>
 
+B<WARNING: there are known timezone issues with worker and event mpms, please
+try other mpms or use mod_fastcgi instead for now.>
+
     <VirtualHost rt.example.com>
         ### Optional apache logs for RT
         # ErrorLog /opt/rt4/var/log/apache2.error

-----------------------------------------------------------------------


More information about the Rt-commit mailing list