Hi, it's very rare event, I noticed it by accident, so I tried this: $ while ./event-loop-test; do ; done Sometimes it takes time, but the result is: test "event_loop_destroy": exit status 0, pass. lt-event-loop-test: tests/event-loop-test.c:258: event_loop_timer_updates: Assertion `context.count == 2' failed. test "event_loop_timer_updates": signal 6, fail. test "event_loop_timer": exit status 0, pass. test "event_loop_signal": exit status 0, pass. test "event_loop_free_source_with_data": exit status 0, pass. test "event_loop_post_dispatch_check": exit status 0, pass. 6 tests, 5 pass, 1 fail I tried it on fedora and arch linux, master branch of wayland. Regards, Marek Chalupa
Hi, looked a little bit into it. This occasional failure is caused by epoll_wait catching only one timer source. Since we have not guaranteed that both timers will expire exactly at the same time, it may happen that epoll_wait will return before the later timer expires, having only one fd ready. The best fix IMO (tried) would be to add getter for source's fd and poll on the fd until it's ready for reading. This way we could wait for both timers to expire before calling wl_event_loop_dispatch. This would require change in libwayland, though. The solution I therefore chose is just simply sleep a while before entering the epoll_wait, so that we are "sure" that both timers expired. Along with the patch solving this, I'm attaching patch that adds some asserts into this test and fixes wrong indentation. Cheers, Marek
Created attachment 104879 [details] [review] Add asserts, fix indentation
Created attachment 104880 [details] [review] Sleep 15ms before entering epoll_wait
Created attachment 104881 [details] [review] Add asserts, fix indentation Oops, seems like loading the patch failed. This is the same patch loaded again.
Both patches pushed. commit b24fa4c8216e3f0f7b644c7b8c6949925f19ada9 Author: Marek Chalupa <mchqwerty@gmail.com> Date: Tue Aug 19 12:03:48 2014 +0200 tests: fix event_loop_timer_updates commit 12ec657014d7fda1c9ebb0358a72bd1a4b5d868c Author: Marek Chalupa <mchqwerty@gmail.com> Date: Tue Aug 19 10:34:52 2014 +0200 tests: event_loop_timer_updates - add asserts and fix indentation I assume this fixes the issue.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.