Add sleeps to avoid race condition in network test