test/test_poll.rb in kgio-2.11.2 vs test/test_poll.rb in kgio-2.11.3

- old
+ new

@@ -41,11 +41,10 @@ assert diff >= 0.010, "diff=#{diff}" assert_nil res end def test_poll_close - foo = nil thr = Thread.new { sleep 0.100; @wr.close } t0 = Time.now res = Kgio.poll({@rd => Kgio::POLLIN}) diff = Time.now - t0 thr.join @@ -53,22 +52,21 @@ assert diff >= 0.010, "diff=#{diff}" end def test_signal_close orig = trap(:USR1) { @rd.close } - res = nil thr = Thread.new { sleep 0.100; Process.kill(:USR1, $$) } t0 = Time.now assert_raises(IOError) do result = Kgio.poll({@rd => Kgio::POLLIN}) result.each_key { |io| io.read_nonblock(1) } end diff = Time.now - t0 thr.join assert diff >= 0.010, "diff=#{diff}" - ensure - trap(:USR1, orig) + ensure + trap(:USR1, orig) end def test_poll_EINTR ok = false orig = trap(:USR1) { ok = true } @@ -81,11 +79,11 @@ diff = Time.now - t0 thr.join assert_nil res assert diff >= 1.0, "diff=#{diff}" assert ok - ensure - trap(:USR1, orig) + ensure + trap(:USR1, orig) end def test_poll_signal_torture usr1 = 0 empty = 0