[Rt-commit] rt branch, 4.4/fix-oracle-session-tests, created. rt-4.4.3-191-g9746943ee

? sunnavy sunnavy at bestpractical.com
Fri Jan 11 10:45:26 EST 2019


The branch, 4.4/fix-oracle-session-tests has been created
        at  9746943eeeb20e4304d71e38a5e8f8b928f81a10 (commit)

- Log -----------------------------------------------------------------
commit 9746943eeeb20e4304d71e38a5e8f8b928f81a10
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Jan 10 22:35:01 2019 +0800

    Fix session.t on Oracle with not-inline web servers
    
    Web server hangs when processing the same session row after the tied
    %session. It seems that the tied %session and web server cause a locking
    conflict somehow.
    
    This commit gets around the hanging issue by switching to file session
    instead. It also updates code to get current session id via client agent
    instead of backend, as file session directory is shared among all the
    tests, we can't easily get current session id from backend.

diff --git a/t/web/session.t b/t/web/session.t
index 1f0bb0bfd..b7b7d1dfd 100644
--- a/t/web/session.t
+++ b/t/web/session.t
@@ -6,6 +6,13 @@ use RT::Test tests => undef;
 
 plan skip_all => 'SQLite has shared file sessions' if RT->Config->Get('DatabaseType') eq 'SQLite';
 
+# Web server hangs when processing the same session row after tied
+# %session on Oracle with non-inline web servers :/
+# Use file session instead for now.
+if ( RT->Config->Get('DatabaseType') eq 'Oracle' && ( $ENV{'RT_TEST_WEB_HANDLER'} || '' ) ne 'inline' ) {
+    RT->Config->Set( 'WebSessionClass', 'Apache::Session::File' );
+}
+
 my ($baseurl, $agent) = RT::Test->started_ok;
 my $url = $agent->rt_base_url;
 
@@ -25,15 +32,12 @@ diag "Test server running at $baseurl";
     $agent->content_contains("Logout", "Found a logout link");
 }
 
-my $ids_ref = RT::Interface::Web::Session->Ids();
-
-# Should only have one session id at this point.
-is( scalar @$ids_ref, 1, 'Got just one session id');
+my ($session_id) = $agent->cookie_jar->as_string =~ /RT_SID_[^=]+=(\w+);/;
 
 diag 'Load session for root user';
 my %session;
-tie %session, 'RT::Interface::Web::Session', $ids_ref->[0];
-is ( $session{'_session_id'}, $ids_ref->[0], 'Got session id ' . $ids_ref->[0] );
+tie %session, 'RT::Interface::Web::Session', $session_id;
+is ( $session{'_session_id'}, $session_id, 'Got session id ' . $session_id );
 is ( $session{'CurrentUser'}->Name, 'root', 'Session is for root user' );
 
 diag 'Test queues cache';
@@ -51,8 +55,8 @@ sleep 1;
 $agent->get($url);
 is ($agent->status, 200, "Loaded a page");
 
-tie %session, 'RT::Interface::Web::Session', $ids_ref->[0];
-is ( $session{'_session_id'}, $ids_ref->[0], 'Got session id ' . $ids_ref->[0] );
+tie %session, 'RT::Interface::Web::Session', $session_id;
+is ( $session{'_session_id'}, $session_id, 'Got session id ' . $session_id );
 is ( $session{'CurrentUser'}->Name, 'root', 'Session is for root user' );
 is ($last_updated, $session{'SelectObject---RT::Queue---' . $user_id . '---CreateTicket---0'}{'lastupdated'},
     "lastupdated is still $last_updated");

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


More information about the rt-commit mailing list