From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS6939 64.71.128.0/18 X-Spam-Status: No, score=-1.9 required=3.0 tests=AWL,BAYES_00, MSGID_FROM_MTA_HEADER shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Eric Wong Newsgroups: gmane.comp.lang.ruby.posix-mq.general Subject: Re: [PATCH 3/3] Add a sleep in alarm test in current Ruby. Date: Wed, 4 Jul 2012 00:20:17 +0000 Message-ID: <20120704002017.GA14457@dcvr.yhbt.net> References: <1341346430-8113-1-git-send-email-375GNU@Gmail.COM> <1341346430-8113-3-git-send-email-375GNU@Gmail.COM> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1341361247 10604 80.91.229.3 (4 Jul 2012 00:20:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 4 Jul 2012 00:20:47 +0000 (UTC) To: ruby.posix.mq@librelist.com Original-X-From: ruby.posix.mq@librelist.com Wed Jul 04 02:20:45 2012 Return-path: Envelope-to: gclrpg-ruby.posix.mq@m.gmane.org List-Archive: List-Help: List-Id: List-Post: List-Subscribe: List-Unsubscribe: Precedence: list Original-Sender: ruby.posix.mq@librelist.com Xref: news.gmane.org gmane.comp.lang.ruby.posix-mq.general:98 Archived-At: Received: from zedshaw.xen.prgmr.com ([64.71.167.205]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SmDKk-0007KH-99 for gclrpg-ruby.posix.mq@m.gmane.org; Wed, 04 Jul 2012 02:20:42 +0200 Received: from zedshaw.xen.prgmr.com (localhost [IPv6:::1]) by zedshaw.xen.prgmr.com (Postfix) with ESMTP id 4CC6021E0E2 for ; Wed, 4 Jul 2012 00:29:23 +0000 (UTC) Hleb Valoshka <375gnu@gmail.com> wrote: > Without that sleep alarms will be 0. Looks like Ruby VM issue. Thanks, your other two patches look good and I've pushed them. Can you elaborate on this issue? I would like to see a bug report/analysis to Ruby upstream (and or EGLIBC) maintainers. I assume this only happens on GNU/kFreeBSD? > --- a/test/test_posix_mq.rb > +++ b/test/test_posix_mq.rb > @@ -127,6 +127,7 @@ class Test_POSIX_MQ < Test::Unit::TestCase > a = nil > assert_raises(Errno::EINTR) { a = @mq.receive } > elapsed = Time.now - t0 > + sleep 0.01 if RUBY_VERSION >= '1.9' > assert_nil a > assert elapsed >= interval, elapsed.inspect > assert elapsed < 1.10, elapsed.inspect Fwiw, I'm not sure if this is a good test, either. Since I wrote this code, I've come to believe normal API methods should not raise Errno::EINTR. I've changed a few of my other libraries (sleepy_penguin, kgio) to avoid EINTR but missed this one.