On Tue, Dec 29, 2015 at 11:15:38AM +0000, Daniel Stone wrote: > Hi Jonas, > > On 29 December 2015 at 02:10, Jonas Ådahl <[email protected]> wrote: > > + /* The server will not actually destroy the client until it receives > > + * input, so send something to trigger the client destruction. */ > > + callback = wl_display_sync(client->wl_display); > > + wl_callback_destroy(callback); > > + > > + /* Sleep some to give the server a chance to react and destroy the > > + * client. */ > > + test_usleep(200000); > > I don't really love the forced 200ms wait here; I'd prefer to do a > kernel-style early exit from time-bounded wait, e.g.: > timeout = now() + MS(200); > while (now() < timeout) > check_for_error_using_*(); /* will block until error arrives */ > while (now() < timeout) { > if (wl_display_dispatch() == 0) { > msleep(10); > continue; /* fd still alive; give server time to kill it */ > } > assert(errno == EPIPE); > }
With the bugs unfixed, this would cause the test case to mostly pass anyway, since the client will often have passed the flush state before the server reached the close state. There needs to either be some out-of-band synchronization mechanism making the client always wait until the server has closed the socket, or a dumb sleep, which seemed much easier. Jonas > > Aside from this and my comment on the roundtrip rewrite, for the series: > Reviewed-by: Daniel Stone <[email protected]> > > Cheers, > Daniel _______________________________________________ wayland-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/wayland-devel
