From bcd984f02fdfd74436df2cff8f2d9fe27f005566 Mon Sep 17 00:00:00 2001 From: normal Date: Tue, 5 Jun 2018 22:28:49 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/io/console/test_io_console.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb index 1368502b04..73c97a6ceb 100644 --- a/test/io/console/test_io_console.rb +++ b/test/io/console/test_io_console.rb @@ -12,6 +12,16 @@ end 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) and TestIO_Console.class_eval do 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) and TestIO_Console.class_eval do 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.class_eval do 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.class_eval do 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