From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Bavier Subject: bug#28779: tests/workers.scm failure Date: Fri, 17 Nov 2017 02:58:12 +0000 Message-ID: References: , <87shdelj7x.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFWrz-0005AD-IH for bug-guix@gnu.org; Thu, 16 Nov 2017 21:59:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFWrv-0001Nk-HM for bug-guix@gnu.org; Thu, 16 Nov 2017 21:59:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:35393) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eFWrv-0001Nb-DX for bug-guix@gnu.org; Thu, 16 Nov 2017 21:59:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eFWrv-0007IU-3A for bug-guix@gnu.org; Thu, 16 Nov 2017 21:59:03 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87shdelj7x.fsf@gnu.org> Content-Language: en-US List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: "28779@debbugs.gnu.org" <28779@debbugs.gnu.org> Looks good to me. Thanks, Eric Bavier, Scientific Libraries, Cray Inc. ________________________________________ From: Ludovic Court=E8s Sent: Thursday, November 16, 2017 02:29 To: Eric Bavier Cc: 28779@debbugs.gnu.org Subject: Re: bug#28779: tests/workers.scm failure Hi Eric, Eric Bavier skribis: > test-name: enqueue > location: /home/users/bavier/src/guix/tests/workers.scm:26 > source: > + (test-equal > + "enqueue" > + 4242 > + (let* ((pool (make-pool)) > + (result 0) > + (#{1+!}# (let ((lock (make-mutex))) > + (lambda () > + (with-mutex lock (set! result (+ result 1))))))) > + (let loop ((i 4242)) > + (unless > + (zero? i) > + (pool-enqueue! pool #{1+!}#) > + (loop (- i 1)))) > + (let poll () > + (unless > + (pool-idle? pool) > + (pk 'busy result) > + (sleep 1) > + (poll))) > + result)) > expected-value: 4242 > actual-value: 4241 > result: FAIL > > > To me the reason seems to be that the 'pool-idle? procedure indicates whe= ther or not the task queue is empty, not whether all tasks have completed e= xecution, so the poll loop exits before all 1+! updates are finished and th= e test fails. Indeed, good catch. The attached patch is a bit crude but it should fix the problem. Thoughts? Thanks, Ludo=92.