Try to avoid race condition that causes test to fail sometimes