[JBTM-2242] Wait for threads before testing assertions