guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding a TOR system test - confusing results


From: Chris Marusich
Subject: Re: Adding a TOR system test - confusing results
Date: Thu, 26 Jul 2018 22:13:55 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

address@hidden (Ludovic Courtès) writes:

> Chris Marusich <address@hidden> 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 ‘sleep’
> 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 have a related question.  Is there a guarantee that the test case will
begin after the TOR service has started up?  The test passes
consistently, which is good.  However, I can't find any code that
guarantees that the test case will begin after TOR has started up.  In
order to make the test succeed even if it happens to check TOR before
TOR has started up, I think I need to check the TOR service in a loop
and eventually time out if it doesn't show up after a while.  That will
be difficult to implement if I can't rely on the "sleep" procedure.

In short, my questions are:

* Why does the sleep get interrupted?
* Do I need to periodically poll for TOR's health in my test?

I appreciate your time answering these detailed questions.  Thank you.

-- 
Chris

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]