[JBTM-2242] Wait for test threads before making assertions