tests: explicitly wait for the PG to finish before looking for capture file