* [PATCH 0/3] test fixes for GNU/kFreeBSD (and possibly other *BSDs) @ 2012-07-11 22:34 Eric Wong 2012-07-11 22:34 ` [PATCH 1/3] test_poll: skip signal torture on Debian GNU/kfreebsd Eric Wong ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: Eric Wong @ 2012-07-11 22:34 UTC (permalink / raw) To: kgio Pushed to "master" of git://bogomips.org/kgio (commit f020550fc802f299fdcdec695ac80d53ef3d24d9) 1 test_poll: skip signal torture on Debian GNU/kfreebsd 2 test/lib_read_write: wait for readability before tryread 3 test workaround for platforms with unreliable signals test/lib_read_write.rb | 1 + test/lib_server_accept.rb | 8 ++++---- test/test_poll.rb | 8 +++----- 3 files changed, 8 insertions(+), 9 deletions(-) ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/3] test_poll: skip signal torture on Debian GNU/kfreebsd 2012-07-11 22:34 [PATCH 0/3] test fixes for GNU/kFreeBSD (and possibly other *BSDs) Eric Wong @ 2012-07-11 22:34 ` Eric Wong 2012-07-11 22:34 ` [PATCH 2/3] test/lib_read_write: wait for readability before tryread Eric Wong 2012-07-11 22:34 ` [PATCH 3/3] test workaround for platforms with unreliable signals Eric Wong 2 siblings, 0 replies; 4+ messages in thread From: Eric Wong @ 2012-07-11 22:34 UTC (permalink / raw) To: kgio From: Eric Wong <ew@debkfreebsd.(none)> This cascades test failures on a platform with questionable signal/fork handling. Tested on: Debian GNU/kFreeBSD 6.0 --- test/test_poll.rb | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/test/test_poll.rb b/test/test_poll.rb index 40092cf..3aa8c1f 100644 --- a/test/test_poll.rb +++ b/test/test_poll.rb @@ -126,9 +126,7 @@ class TestPoll < Test::Unit::TestCase _, status = Process.waitpid2(pid) assert status.success?, status.inspect assert usr1 > 0, "usr1: #{usr1}" - rescue Object => err - p [ :err, err ] - ensure - trap(:USR1, "DEFAULT") - end + ensure + trap(:USR1, "DEFAULT") + end unless RUBY_PLATFORM =~ /kfreebsd-gnu/ end if Kgio.respond_to?(:poll) -- 1.7.2.5 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] test/lib_read_write: wait for readability before tryread 2012-07-11 22:34 [PATCH 0/3] test fixes for GNU/kFreeBSD (and possibly other *BSDs) Eric Wong 2012-07-11 22:34 ` [PATCH 1/3] test_poll: skip signal torture on Debian GNU/kfreebsd Eric Wong @ 2012-07-11 22:34 ` Eric Wong 2012-07-11 22:34 ` [PATCH 3/3] test workaround for platforms with unreliable signals Eric Wong 2 siblings, 0 replies; 4+ messages in thread From: Eric Wong @ 2012-07-11 22:34 UTC (permalink / raw) To: kgio From: Eric Wong <ew@debkfreebsd.(none)> On FreeBSD, writing to a loopback TCP socket does not guarantee immediate readability on the other end. Tested on Debian GNU/kFreeBSD 6.0 --- test/lib_read_write.rb | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/test/lib_read_write.rb b/test/lib_read_write.rb index 04d6fc6..586e826 100644 --- a/test/lib_read_write.rb +++ b/test/lib_read_write.rb @@ -242,6 +242,7 @@ module LibReadWriteTest def test_tryread_too_much assert_equal nil, @wr.kgio_trywrite("hi") + assert_equal @rd, @rd.kgio_wait_readable assert_equal "hi", @rd.kgio_tryread(4) end -- 1.7.2.5 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] test workaround for platforms with unreliable signals 2012-07-11 22:34 [PATCH 0/3] test fixes for GNU/kFreeBSD (and possibly other *BSDs) Eric Wong 2012-07-11 22:34 ` [PATCH 1/3] test_poll: skip signal torture on Debian GNU/kfreebsd Eric Wong 2012-07-11 22:34 ` [PATCH 2/3] test/lib_read_write: wait for readability before tryread Eric Wong @ 2012-07-11 22:34 ` Eric Wong 2 siblings, 0 replies; 4+ messages in thread From: Eric Wong @ 2012-07-11 22:34 UTC (permalink / raw) To: kgio From: Eric Wong <ew@debkfreebsd.(none)> Ruby may not respond well to signals on all platforms, especially not after fork()-ing in the face of a running pthread (timer thread on 1.9.2). SIGKILL bypasses Ruby (and all userspace) signal handling on Debian GNU/kFreeBSD. --- test/lib_server_accept.rb | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/lib_server_accept.rb b/test/lib_server_accept.rb index ccf89d8..ff0f733 100644 --- a/test/lib_server_accept.rb +++ b/test/lib_server_accept.rb @@ -47,7 +47,7 @@ module LibServerAccept elapsed = Time.now - t0 assert_kind_of Kgio::Socket, b assert_equal @host, b.kgio_addr - Process.kill(:TERM, pid) + Process.kill(:KILL, pid) Process.waitpid(pid) assert elapsed >= 1, "elapsed: #{elapsed}" end @@ -60,7 +60,7 @@ module LibServerAccept elapsed = Time.now - t0 assert_kind_of Kgio::Socket, b assert_equal @host, b.kgio_addr - Process.kill(:TERM, pid) + Process.kill(:KILL, pid) Process.waitpid(pid) assert elapsed >= 1, "elapsed: #{elapsed}" @@ -70,7 +70,7 @@ module LibServerAccept elapsed = Time.now - t0 assert_kind_of Kgio::Socket, b assert_equal @host, b.kgio_addr - Process.kill(:TERM, pid) + Process.kill(:KILL, pid) Process.waitpid(pid) assert elapsed >= 6, "elapsed: #{elapsed}" @@ -80,7 +80,7 @@ module LibServerAccept elapsed = Time.now - t0 assert_kind_of Kgio::Socket, b assert_equal @host, b.kgio_addr - Process.kill(:TERM, pid) + Process.kill(:KILL, pid) Process.waitpid(pid) assert elapsed >= 1, "elapsed: #{elapsed}" end -- 1.7.2.5 ^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-07-11 22:35 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2012-07-11 22:34 [PATCH 0/3] test fixes for GNU/kFreeBSD (and possibly other *BSDs) Eric Wong 2012-07-11 22:34 ` [PATCH 1/3] test_poll: skip signal torture on Debian GNU/kfreebsd Eric Wong 2012-07-11 22:34 ` [PATCH 2/3] test/lib_read_write: wait for readability before tryread Eric Wong 2012-07-11 22:34 ` [PATCH 3/3] test workaround for platforms with unreliable signals Eric Wong
Code repositories for project(s) associated with this public inbox https://yhbt.net/kgio.git/ This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).