Author: kclark
Date: Tue Jun 17 18:20:25 2008
New Revision: 669043

URL: http://svn.apache.org/viewvc?rev=669043&view=rev
Log:
rb: Switch NonblockingServer spec from Queue to sleep

Using sleep instead of Queue#pop means the thread is killable under JRuby

Modified:
    incubator/thrift/trunk/lib/rb/spec/nonblockingserver_spec.rb

Modified: incubator/thrift/trunk/lib/rb/spec/nonblockingserver_spec.rb
URL: 
http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/spec/nonblockingserver_spec.rb?rev=669043&r1=669042&r2=669043&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/spec/nonblockingserver_spec.rb (original)
+++ incubator/thrift/trunk/lib/rb/spec/nonblockingserver_spec.rb Tue Jun 17 
18:20:25 2008
@@ -142,7 +142,7 @@
             when :hello
               result << client.greeting(true) # ignore result
             when :sleep
-              client.sleep(0.5)
+              client.sleep(args[0] || 0.5)
               result << :slept
             when :shutdown
               client.shutdown
@@ -227,11 +227,12 @@
     it "should kill active messages when they don't expire while shutting 
down" do
       result = Queue.new
       client = setup_client_thread(result)
-      client << :block
+      client << [:sleep, 10]
       sleep 0.1 # start processing the client's message
       @server.shutdown(1)
       @catch_exceptions = true
       @server_thread.join(3).should_not be_nil
+      result.should be_empty
     end
 
     it "should allow shutting down in response to a message" do


Reply via email to