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

ruby-changes:34665

From: usa <ko1@a...>
Date: Mon, 7 Jul 2014 13:09:05 +0900 (JST)
Subject: [ruby-changes:34665] usa:r46748 (ruby_2_0_0): merge revision(s) 46159, 46196: [Backport #8523]

usa	2014-07-07 13:08:55 +0900 (Mon, 07 Jul 2014)

  New Revision: 46748

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

  Log:
    merge revision(s) 46159,46196: [Backport #8523]
    
    * test/test_timeout.rb (test_timeout): inverted test condition.
      [Bug #8523]

  Modified directories:
    branches/ruby_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/test/ruby/test_thread.rb
    branches/ruby_2_0_0/test/test_timeout.rb
    branches/ruby_2_0_0/version.h
Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 46747)
+++ ruby_2_0_0/ChangeLog	(revision 46748)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Mon Jul  7 13:05:04 2014  SHIBATA Hiroshi  <shibata.hiroshi@g...>
+
+	* test/test_timeout.rb (test_timeout): inverted test condition.
+	  [Bug #8523]
+
 Mon Jul  7 12:57:26 2014  Masaya Tarui  <tarui@r...>
 
 	* st.c (st_foreach_check): change start point of search at check
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 46747)
+++ ruby_2_0_0/version.h	(revision 46748)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #define RUBY_VERSION "2.0.0"
 #define RUBY_RELEASE_DATE "2014-07-07"
-#define RUBY_PATCHLEVEL 530
+#define RUBY_PATCHLEVEL 531
 
 #define RUBY_RELEASE_YEAR 2014
 #define RUBY_RELEASE_MONTH 7
Index: ruby_2_0_0/test/ruby/test_thread.rb
===================================================================
--- ruby_2_0_0/test/ruby/test_thread.rb	(revision 46747)
+++ ruby_2_0_0/test/ruby/test_thread.rb	(revision 46748)
@@ -363,6 +363,24 @@ class TestThread < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/ruby/test_thread.rb#L363
     c.kill if c
   end
 
+  def test_switch_while_busy_loop
+    bug1402 = "[ruby-dev:38319] [Bug #1402]"
+    flag = true
+    th = Thread.current
+    waiter = Thread.start {
+      sleep 0.1
+      flag = false
+      sleep 1
+      th.raise(bug1402)
+    }
+    assert_nothing_raised(RuntimeError, bug1402) do
+      nil while flag
+    end
+    assert(!flag, bug1402)
+  ensure
+    waiter.kill.join
+  end
+
   def test_safe_level
     t = Thread.new { $SAFE = 3; sleep }
     sleep 0.5
Index: ruby_2_0_0/test/test_timeout.rb
===================================================================
--- ruby_2_0_0/test/test_timeout.rb	(revision 46747)
+++ ruby_2_0_0/test/test_timeout.rb	(revision 46748)
@@ -11,17 +11,11 @@ class TestTimeout < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/test_timeout.rb#L11
   end
 
   def test_timeout
-    @flag = true
-    Thread.start {
-      sleep 0.1
-      @flag = false
-    }
-    assert_nothing_raised("[ruby-dev:38319]") do
-      Timeout.timeout(1) {
-        nil while @flag
+    assert_raise(Timeout::Error) do
+      Timeout.timeout(0.1) {
+        nil while true
       }
     end
-    assert !@flag, "[ruby-dev:38319]"
   end
 
   def test_cannot_convert_into_time_interval

Property changes on: ruby_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r46159,46196


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

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