From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Adding a TOR system test - confusing results Date: Fri, 27 Jul 2018 10:41:05 +0200 Message-ID: <87va91kr4u.fsf@gnu.org> References: <87k1pmhkp9.fsf@gmail.com> <87y3e2tjfm.fsf@gnu.org> <87wotltjig.fsf@gmail.com> <87effqyv87.fsf@gnu.org> <874lgltg4s.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fiyJF-0006UK-0O for guix-devel@gnu.org; Fri, 27 Jul 2018 04:41:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fiyJA-0004K8-3E for guix-devel@gnu.org; Fri, 27 Jul 2018 04:41:13 -0400 In-Reply-To: <874lgltg4s.fsf@gmail.com> (Chris Marusich's message of "Thu, 26 Jul 2018 22:13:55 -0700") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Chris Marusich Cc: guix-devel@gnu.org Chris Marusich skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> Chris Marusich skribis: >> >>> Why does it pass? The (sleep 999999) form appears to be totally >>> ignored, and I don't understand why. It's concerning to me that I can't >>> understand how the code is being executed. I expected the test to hang. >> >> According to the manual (info "(guile) Signals"): >> >> -- Scheme Procedure: sleep secs >> -- Scheme Procedure: usleep usecs >> -- C Function: scm_sleep (secs) >> -- C Function: scm_usleep (usecs) >> Wait the given period SECS seconds or USECS microseconds (both >> integers). If a signal arrives the wait stops and the return value >> is the time remaining, in seconds or microseconds respectively. If >> the period elapses with no signal the return is zero. >> >> So I suspect that the marionette process got a signal, and thus =E2=80= =98sleep=E2=80=99 >> returned quickly. Could you print its return value? > > Thank you for the reply! The return value is 999998. Like you said, > maybe it's possible that the marionette process got a signal. But why > would that happen? I=E2=80=99m not sure! It could be SIGPIPE or SIGCHLD, this is left as an exercise to you. :-) Seriously, you could register signal handlers and try to see what=E2=80=99s going on. It doesn=E2=80=99t change the fact that the return value of =E2=80=98sleep= =E2=80=99 must be checked, though. > I have a related question. Is there a guarantee that the test case will > begin after the TOR service has started up? Most service tests start by waiting for the service to be up using something like: (marionette-eval '(begin (use-modules (gnu services herd)) (start-service 'mcron)) marionette) That blocks until =E2=80=98mcron=E2=80=99 is up or it has failed to start. HTH! Ludo=E2=80=99.