fix itest flakiness and improve formatting