From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS47066 71.19.144.0/20 X-Spam-Status: No, score=-1.9 required=3.0 tests=AWL,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: normalperson@yhbt.net Received: from zedshaw2.xen.prgmr.com (zedshaw2.xen.prgmr.com [71.19.156.177]) by dcvr.yhbt.net (Postfix) with ESMTP id 27EEF1F6D5 for ; Tue, 30 Apr 2013 02:40:15 +0000 (UTC) Received: from zedshaw2.xen.prgmr.com (unknown [IPv6:::1]) by zedshaw2.xen.prgmr.com (Postfix) with ESMTP id 9B31573DEE for ; Tue, 30 Apr 2013 02:42:12 +0000 (UTC) MIME-Version: 1.0 Date: Tue, 30 Apr 2013 02:39:42 +0000 From: Eric Wong List-Archive: List-Help: List-Id: List-Post: List-Subscribe: List-Unsubscribe: Message-Id: <1367289582-31293-18-git-send-email-normalperson@yhbt.net> Precedence: list References: <1367289582-31293-1-git-send-email-normalperson@yhbt.net> Sender: sleepy.penguin@librelist.org Subject: [sleepy.penguin] [PATCH 17/17] test_epoll: workaround race condition in test_close To: sleepy.penguin@librelist.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Wait longer before killing the epoll_wait thread, as we may not have entered epoll_wait inside that thread before we send Thread#kill to it. This caused intermittent IOError as the thread delected the Epoll::IO object was already closed, before the snapshot (to prevent GC) could be made. --- test/test_epoll.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test_epoll.rb b/test/test_epoll.rb index bdb550b..4b4437a 100644 --- a/test/test_epoll.rb +++ b/test/test_epoll.rb @@ -197,7 +197,8 @@ def test_close thr = Thread.new { @ep.wait { |flags, obj| tmp << [ flags, obj ] } } @rd.close @wr.close - assert_nil thr.join(0.01) + Thread.pass + assert_nil thr.join(0.25) assert thr.alive? thr.kill assert tmp.empty? -- 1.8.2.1.367.gc875ca7