[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    Re: racy tests
From:       Alfred Perlstein <alfred () freebsd ! org>
Date:       2017-04-27 15:35:57
Message-ID: 9478F48E-4619-49F2-A9D8-34335C4A13AA () freebsd ! org
[Download RAW message or body]



> On Apr 27, 2017, at 8:29 AM, Jilles Tjoelker <jilles@stack.nl> wrote:
> 
> > On Thu, Apr 27, 2017 at 05:47:11AM -0700, Alfred Perlstein wrote:
> > Can't something similar to this be done?
> 
> > .(05:40:37)(bright@elvis.mu.org)
> > ~ % mkfifo derp
> > .(05:43:46)(bright@elvis.mu.org)
> > ~ % cat derp &
> > [1] 59244
> > .(05:43:53)(bright@elvis.mu.org)
> > ~ % ( pwait $! && echo "$?" > ex_status )&
> > [2] 59263
> > .(05:44:28)(bright@elvis.mu.org)
> > ~ % echo "hi" >> derp && echo "exit status: $(cat ex_status)"
> > hi
> > [2]  + done       ( pwait $! && echo "$?" > ex_status; )
> > [1]  + done       cat derp
> > exit status: 0
> 
> > Make a fifo, lodge a cat(1) process waiting for data, pwait in the
> > background and stuff pwait's status into a file, then unstick the
> > cat(1) by writing to the fifo, and then read the exit status from
> > pwait from the file?
> 
> Fifos are indeed a good idea. They are used various times in the /bin/sh
> tests, which should not wait for any sleeps in successful test runs (my
> main motivation for this is to be able to run the whole suite in a few
> seconds).
> 
> In this case, however, the -t option being tested is inherently related
> to time. It would be possible to cheat by passing a very long timeout
> and cut it short by sending SIGALRM using kill (which depends on the
> concrete implementation).

Makes sense. I was worried this was the case but I couldn't find any useful docs on \
atf commands via google and man(3) on a 10.3 system. Thank you, your idea makes \
sense. 


> 
> -- 
> Jilles Tjoelker
> 

_______________________________________________
freebsd-hackers@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic