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: AS47066 71.19.144.0/20 X-Spam-Status: No, score=-1.2 required=3.0 tests=BAYES_00,FREEMAIL_FROM, FROM_STARTS_WITH_NUMS,MSGID_FROM_MTA_HEADER shortcircuit=no autolearn=no version=3.3.2 Path: news.gmane.org!not-for-mail From: Hleb Valoshka <375gnu@gmail.com> Newsgroups: gmane.comp.lang.ruby.kgio.general Subject: Re: Concurrency issue in TestKgioUnixConnect? Date: Thu, 5 Sep 2013 23:53:03 +0300 Message-ID: References: <20130901140301.GI1272@loar> <20130901195835.GB30612@dcvr.yhbt.net> <20130902212429.GA18310@dcvr.yhbt.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1378414395 5922 80.91.229.3 (5 Sep 2013 20:53:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Sep 2013 20:53:15 +0000 (UTC) To: kgio@librelist.org Original-X-From: kgio@librelist.org Thu Sep 05 22:53:19 2013 Return-path: Envelope-to: gclrkg-kgio@m.gmane.org List-Archive: List-Help: List-Id: List-Post: List-Subscribe: List-Unsubscribe: Precedence: list Original-Sender: kgio@librelist.org Xref: news.gmane.org gmane.comp.lang.ruby.kgio.general:213 Archived-At: Received: from zedshaw2.xen.prgmr.com ([71.19.156.177]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VHgYI-0007qB-18 for gclrkg-kgio@m.gmane.org; Thu, 05 Sep 2013 22:53:18 +0200 Received: from zedshaw2.xen.prgmr.com (unknown [IPv6:::1]) by zedshaw2.xen.prgmr.com (Postfix) with ESMTP id 79AA173E30 for ; Thu, 5 Sep 2013 21:02:22 +0000 (UTC) On 9/3/13, Hleb Valoshka <375gnu@gmail.com> wrote: > I was able to reproduce it only one or two times in virtualized > GNU/kFreeBSD. Problem is more interesting. I decided to check your latest changes for test_poll.rb under kfreebsd-i386 and i'd got failure in test_unix_connect.rb with teardown of test_unix_socket_new_invalid: 1) Error: test_unix_socket_new_invalid(TestKgioUnixConnect): Errno::ENOENT: No such file or directory - /tmp/kgio_unix_120130906-13330-m89438/kgio_unix_120130906-13330-ch4t73 test/test_unix_connect.rb:33:in `unlink' test/test_unix_connect.rb:33:in `teardown' The same failure as on ia64, mipsel and x32 Jeremy pointed in the first message. And it definitely not a race condition because for the next time i run it as make test/test_unix_connect.rb So I decided to add some debug output: def setup ... puts "\n\nsetup" system 'ls -lR /tmp/kgio*' end def teardown puts "\nteardown" system 'ls -lR /tmp/kgio*' ... end def test_unix_socket_new_invalid puts "\ntest in" system 'ls -lR /tmp/kgio*' assert_raises(ArgumentError) { Kgio::UNIXSocket.new('*' * 1024 * 1024) } puts "\ntest out" system 'ls -lR /tmp/kgio*' end And voila: # Running tests: ... setup /tmp/kgio_unix_120130906-13330-m89438: total 0 srwxr-xr-x 1 root root 0 Sep 6 01:23 kgio_unix_120130906-13330-ch4t73 test in /tmp/kgio_unix_120130906-13330-m89438: total 0 srwxr-xr-x 1 root root 0 Sep 6 01:23 kgio_unix_120130906-13330-ch4t73 test out /tmp/kgio_unix_120130906-13330-m89438: total 0 teardown /tmp/kgio_unix_120130906-13330-m89438: total 0 E ... The socket has disappeared somewhere. Interesting, isn't it? The more interesting that kfreebsd on amd64 doesn't have this issue. Both are up-to-date Debian Sid. Any ideas? > I think the problem is caused by parallel tests invocation in ruby 1.9 It seems that I was wrong: it's possible to invoke tests in parallel, and there is an explicit option for this `--jobs'. But it doesn't mean, that tests are invoked in parallel by default.