Attempt to make the login overlay tests more robust.