fix intermittent failing test by ensuring we wait for persistence to complete