[Bug 29702] Unit tests are racy/buggy

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Aug 22 18:30:09 CEST 2010


https://bugs.freedesktop.org/show_bug.cgi?id=29702

--- Comment #2 from Olli Salli <ollisal at gmail.com> 2010-08-22 09:30:09 PDT ---
The fixes bring about some graciously overlapping rules-of-thumb for
implementing tests:
 - NEVER assume that only one event happens when you call processEvents()
unless further events can't happen without additional requests (otherwise, if
the test executes slower than the service, two service events may happen, which
then get processed with one processEvents() call and any checks depending on
those events after that call are then unpredictable)
 - NEVER implement a while (state != desired) {processEvents()} style loop if
the state can go to desired and back to something else without making further
requests (otherwise Murphy says it will go to desired during a processEvents()
call, and then again to something undesired during that same call, and never go
back to desired afterwards - so we'll just busy-loop infinitely...)
 - NEVER assume that you can reach checking that an event has happened (such as
you asking somebody for their presence) before another simulated event
overwriting it (such as them accepting) happens
 - even more generally, NEVER assume that you can reach starting to wait for a
simulated network event to happen before it already happened (so always check
for it to not have already happened before starting to wait)

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.



More information about the telepathy-bugs mailing list