From: Eric Bavier <bavier@cray.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: "28779@debbugs.gnu.org" <28779@debbugs.gnu.org>
Subject: bug#28779: tests/workers.scm failure
Date: Fri, 17 Nov 2017 02:58:12 +0000 [thread overview]
Message-ID: <CY4PR11MB1718FE00CE3817392B4F2EDBB72F0@CY4PR11MB1718.namprd11.prod.outlook.com> (raw)
In-Reply-To: <87shdelj7x.fsf@gnu.org>
Looks good to me.
Thanks,
Eric Bavier, Scientific Libraries, Cray Inc.
________________________________________
From: Ludovic Courtès <ludo@gnu.org>
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 <bavier@cray.com> 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 whether or not the task queue is empty, not whether all tasks have completed execution, so the poll loop exits before all 1+! updates are finished and the test fails.
Indeed, good catch.
The attached patch is a bit crude but it should fix the problem.
Thoughts?
Thanks,
Ludo’.
next prev parent reply other threads:[~2017-11-17 2:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-10 15:48 bug#28779: tests/workers.scm failure Eric Bavier
2017-11-16 8:29 ` Ludovic Courtès
2017-11-17 2:58 ` Eric Bavier [this message]
2017-11-17 10:10 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CY4PR11MB1718FE00CE3817392B4F2EDBB72F0@CY4PR11MB1718.namprd11.prod.outlook.com \
--to=bavier@cray.com \
--cc=28779@debbugs.gnu.org \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).