CLOUDIFY-2386 added timeout to events while loop