[前][次][番号順一覧][スレッド一覧]

ruby-changes:42337

From: naruse <ko1@a...>
Date: Wed, 30 Mar 2016 00:52:57 +0900 (JST)
Subject: [ruby-changes:42337] naruse:r54411 (ruby_2_3): merge revision(s) 54025: [Backport #12167]

naruse	2016-03-30 00:52:51 +0900 (Wed, 30 Mar 2016)

  New Revision: 54411

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54411

  Log:
    merge revision(s) 54025: [Backport #12167]
    
    * test/net/imap/test_imap.rb (test_idle_timeout): Because of the
      timeout specified in "imap.idle(0.2)", there is no gurantee that
      the server thread has done all the work before the client thread
      performs the assertions. It depends on the thread scheduling.
      Add checks to avoid false positives (on AIX, particularly).

  Modified directories:
    branches/ruby_2_3/
  Modified files:
    branches/ruby_2_3/ChangeLog
    branches/ruby_2_3/test/net/imap/test_imap.rb
    branches/ruby_2_3/version.h
Index: ruby_2_3/version.h
===================================================================
--- ruby_2_3/version.h	(revision 54410)
+++ ruby_2_3/version.h	(revision 54411)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1
 #define RUBY_VERSION "2.3.0"
 #define RUBY_RELEASE_DATE "2016-03-30"
-#define RUBY_PATCHLEVEL 59
+#define RUBY_PATCHLEVEL 60
 
 #define RUBY_RELEASE_YEAR 2016
 #define RUBY_RELEASE_MONTH 3
Index: ruby_2_3/ChangeLog
===================================================================
--- ruby_2_3/ChangeLog	(revision 54410)
+++ ruby_2_3/ChangeLog	(revision 54411)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ChangeLog#L1
+Wed Mar 30 00:52:47 2016  Rei Odaira  <Rei.Odaira@g...>
+
+	* test/net/imap/test_imap.rb (test_idle_timeout): Because of the
+	  timeout specified in "imap.idle(0.2)", there is no gurantee that
+	  the server thread has done all the work before the client thread
+	  performs the assertions. It depends on the thread scheduling.
+	  Add checks to avoid false positives (on AIX, particularly).
+
 Wed Mar 30 00:41:42 2016  Rei Odaira  <Rei.Odaira@g...>
 
 	* test/socket/test_socket.rb (test_udp_recvmsg_truncation):
Index: ruby_2_3/test/net/imap/test_imap.rb
===================================================================
--- ruby_2_3/test/net/imap/test_imap.rb	(revision 54410)
+++ ruby_2_3/test/net/imap/test_imap.rb	(revision 54411)
@@ -310,19 +310,31 @@ class IMAPTest < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/net/imap/test_imap.rb#L310
     begin
       imap = Net::IMAP.new(SERVER_ADDR, :port => port)
       responses = []
-        Thread.pass
+      Thread.pass
       imap.idle(0.2) do |res|
         responses.push(res)
       end
-      assert_equal(3, responses.length)
-      assert_instance_of(Net::IMAP::ContinuationRequest, responses[0])
-      assert_equal("EXISTS", responses[1].name)
-      assert_equal(3, responses[1].data)
-      assert_equal("EXPUNGE", responses[2].name)
-      assert_equal(2, responses[2].data)
-      assert_equal(2, requests.length)
-      assert_equal("RUBY0001 IDLE\r\n", requests[0])
-      assert_equal("DONE\r\n", requests[1])
+      # There is no gurantee that this thread has received all the responses,
+      # so check the response length.
+      if responses.length > 0
+        assert_instance_of(Net::IMAP::ContinuationRequest, responses[0])
+        if responses.length > 1
+          assert_equal("EXISTS", responses[1].name)
+          assert_equal(3, responses[1].data)
+          if responses.length > 2
+            assert_equal("EXPUNGE", responses[2].name)
+            assert_equal(2, responses[2].data)
+          end
+        end
+      end
+      # Also, there is no gurantee that the server thread has stored
+      # all the requests into the array, so check the length.
+      if requests.length > 0
+        assert_equal("RUBY0001 IDLE\r\n", requests[0])
+        if requests.length > 1
+          assert_equal("DONE\r\n", requests[1])
+        end
+      end
       imap.logout
     ensure
       imap.disconnect if imap

Property changes on: ruby_2_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r54025


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]