Rewrote avatar tests to wait until certain events rather than fixed time