rpbraswell-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Aug-08 16:34 UTC
Rails Session Problem
Rails 1.2.3 Ruby 1.8.5 Mongrel 1.0.1 Mongrel cluster 1.0.2 (using 2 instances) Apache 2.2.4 RAILS_ENV=production session storage = PStore Solaris 10 (11/06) Background: I have devloped an automated test system for the system which our group supports. It uses a terminal server to connect to the serial I/O on the system and uses a LAN connection to mount NFS shares on the target system, connect to the databases on the target system, etc. Employed on Solaris 10 X64, using Oracle 10g, Ruby, RoR (admin and control), & DRb (for supporting a publish/subscribe system used by the test executive, simulator and evaluator daemons). I have run a sequence of tests using just one browser session. The sequence of tests alternates between two tests which I will call test1 and test2. On the 10th execution which should have been the 5th execution for test2, test1 was executed instead. Below is a fragment of production.log and a fragment of test_exec_controller.rb showing that what should have been put into session[:sys_test_ids]. Why would this work most of the time but fail occasionally? Could there be a problem at times with flushing the session objects to disk s.t. when the next test is run, the previous test''s id was still there? Any additional troubleshooting suggestions? # # annotated fragment of production.log with addresses elided # # # get for the initial start page which contains two sortable, drag & drop lists # Processing TestExecController#start_test_run (for ... at 2007-08-08 08:23:14) [GET] Session ID: 03572c6b0c71beae829a12e89faebc8c Parameters: {"action"=>"start_test_run", "controller"=>"test_exec"} Rendering within layouts/application Rendering test_exec/start_test_run Completed in 0.01097 (91 reqs/sec) | Rendering: 0.00769 (70%) | DB: 0.00136 (12%) | 200 OK [http://...] # # AJAX calls to move test 44 to selected tests, 28 & 57 are still available # Processing TestExecController#update_test_run (for ... at 2007-08-08 08:23:25) [POST] Session ID: 03572c6b0c71beae829a12e89faebc8c Parameters: {"available_tests"=>["28", "57"], "action"=>"update_test_run", "controller"=>"test_exec"} Completed in 0.00244 (409 reqs/sec) | Rendering: 0.00006 (2%) | DB: 0.00110 (45%) | 200 OK [http://...] Processing TestExecController#update_test_run (for ... at 2007-08-08 08:23:25) [POST] Session ID: 03572c6b0c71beae829a12e89faebc8c Parameters: {"selected_tests"=>["44"], "action"=>"update_test_run", "controller"=>"test_exec"} Completed in 0.00222 (449 reqs/sec) | Rendering: 0.00006 (2%) | DB: 0.00095 (42%) | 200 OK [http://...] # # action for the form to start the tests just selected # # the ''******** running tests 28'' should be ''******** running tests 44'' # Processing TestExecController#start_test_run (for ... at 2007-08-08 08:23:26) [POST] Session ID: 03572c6b0c71beae829a12e89faebc8c Parameters: {"test_run"=>{"tag"=>"fdio 5"}, "commit"=>"START", "iterations"=>"1", "action"=>"start_test_run", "controller"=>"test_exec"} ******** running tests 28 Redirected to http://... Completed in 0.01929 (51 reqs/sec) | DB: 0.00254 (13%) | 302 Found [http://... class TestExecController < ApplicationController def start_test_run # don''t put @sys_tests in request.get? in case @test_run.save fails # and we go back into the start_test_run view @sys_tests = SysTest.find(:all) if request.get? @test_run = TestRun.new session[:sys_tests_ids] = [] else @test_run = TestRun.new(params[:test_run]) @test_run.engineer = @me @test_run.began_at = Time.now if session[:sys_test_ids].nil? || session[:sys_test_ids].empty? @test_run.errors.add_to_base( "You must select at least one test") return end if @test_run.save logger.info("******** running tests #{session[:sys_test_ids]}") @test_exec.start_test_run :test_run => @test_run, :tests => session[:sys_test_ids], :iterations => params[:iterations] redirect_to :action => :status end end end ... # # This method is the result of an AJAX call from the start test run page # when the contents of the ''Selected Tests'' or Available Tests'' lists are modified. # def update_test_run session[:sys_test_ids] = params[:selected_tests] if params[:selected_tests] render :nothing => true end ... end Ron --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---