I couldn't work out any way to wait on contact/event resolution for this test, and it does sometimes exceed 5 seconds(!).  Contact resolution is ridiculously slow in these tests, but I haven't investigated why.  Are you doing anything at the moment (or near future) that would conflict with libcontacts integration?