[CRIU] [PATCH v2] zdtm: test -- Add trivial poll() timeout test
Cyrill Gorcunov
gorcunov at gmail.com
Wed Mar 18 04:29:29 PDT 2015
On Wed, Mar 18, 2015 at 01:49:43PM +0300, Andrew Vagin wrote:
> > +
> > + task_waiter_complete(&t, 1);
> > + delta = 5;
> > + while (futex_get(f) != 1) {
>
> We can use test_go() here
Ah, thanks, completely forget that we've this helper.
>
> > + ret = poll(ufds, 2, delta * 1000);
> > + show_pollfd(ufds, 2);
> > + if (ret) {
> > + err("Poll-2 returned %d (events?!)", ret);
> > + exit(1);
> > + }
> > + }
> > +
> > + task_waiter_wait4(&t, 2);
>
> Why do we need this synchronization?
Well, with test_go (and futex underneath) this become redundant, thanks.
> > +
> > + show_timestamp("Stop", time2.tv_sec, time2.tv_usec);
> > + show_timestamp("Diff", time2.tv_sec - time1.tv_sec,
> > + time2.tv_usec - time1.tv_usec);
> > + if ((time2.tv_sec - time1.tv_sec) > delta) {
>
> We can call poll a few time in a loop and the test should not fail in
> this case.
Not really sure I follow here. How it's different from a single poll call?
I mean we're testing that poll get not screwed on timeout after restore,
why one poll call is not enough here?
> > + test_daemon();
> > + test_waitsig();
> > +
> > + futex_set(f, 1);
>
> kill(pid, SIGTERM);
sure, thanks
More information about the CRIU
mailing list