summaryrefslogtreecommitdiff
path: root/test/io
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-05 22:28:49 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-05 22:28:49 +0000
commitbcd984f02fdfd74436df2cff8f2d9fe27f005566 (patch)
tree75fd76609313d369c3a62da4ea94a5df5604d4a8 /test/io
parent4e730838a00d7dc40931d1c6efb2008bac702e93 (diff)
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
Diffstat (limited to 'test/io')
-rw-r--r--test/io/console/test_io_console.rb16
1 files changed, 16 insertions, 0 deletions
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