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

ruby-changes:51377

From: normal <ko1@a...>
Date: Wed, 6 Jun 2018 07:28:55 +0900 (JST)
Subject: [ruby-changes:51377] normal:r63583 (trunk): test/io/console/test_io_console.rb: ignore TTOU on FreeBSD

normal	2018-06-06 07:28:49 +0900 (Wed, 06 Jun 2018)

  New Revision: 63583

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

  Log:
    test/io/console/test_io_console.rb: ignore TTOU on FreeBSD
    
    I'm not entirely sure why, but SIGTTOU pauses the test
    when running test-all in parallel.

  Modified files:
    trunk/test/io/console/test_io_console.rb
Index: test/io/console/test_io_console.rb
===================================================================
--- test/io/console/test_io_console.rb	(revision 63582)
+++ test/io/console/test_io_console.rb	(revision 63583)
@@ -12,6 +12,16 @@ end https://github.com/ruby/ruby/blob/trunk/test/io/console/test_io_console.rb#L12
 defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do
   Bug6116 = '[ruby-dev:45309]'
 
+  # FreeBSD seems to hang on TTOU when running parallel tests
+  # tested on FreeBSD 11.x
+  def set_winsize_setup
+    @old_ttou = trap(:TTOU, 'IGNORE') if RUBY_PLATFORM =~ /freebsd/i
+  end
+
+  def set_winsize_teardown
+    trap(:TTOU, @old_ttou) if @old_ttou
+  end
+
   def test_raw
     helper {|m, s|
       s.print "abc\n"
@@ -255,6 +265,7 @@ defined?(PTY) and defined?(IO.console) a https://github.com/ruby/ruby/blob/trunk/test/io/console/test_io_console.rb#L265
   end
 
   def test_set_winsize_invalid_dev
+    set_winsize_setup
     [IO::NULL, __FILE__].each do |path|
       open(path) do |io|
         begin
@@ -267,6 +278,8 @@ defined?(PTY) and defined?(IO.console) a https://github.com/ruby/ruby/blob/trunk/test/io/console/test_io_console.rb#L278
         assert_raise(ArgumentError) {io.winsize = [0, 0, 0]}
       end
     end
+  ensure
+    set_winsize_teardown
   end
 
   unless IO.console
@@ -322,6 +335,7 @@ defined?(IO.console) and TestIO_Console. https://github.com/ruby/ruby/blob/trunk/test/io/console/test_io_console.rb#L335
     end
 
     def test_set_winsize_console
+      set_winsize_setup
       s = IO.console.winsize
       assert_nothing_raised(TypeError) {IO.console.winsize = s}
       bug = '[ruby-core:82741] [Bug #13888]'
@@ -329,6 +343,8 @@ defined?(IO.console) and TestIO_Console. https://github.com/ruby/ruby/blob/trunk/test/io/console/test_io_console.rb#L343
       assert_equal([s[0], s[1]+1], IO.console.winsize, bug)
       IO.console.winsize = s
       assert_equal(s, IO.console.winsize, bug)
+    ensure
+      set_winsize_teardown
     end
 
     def test_close

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

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