Avoid race conditions between the test flow and events by waiting for all started events to finish execution after switching off event scheduler