Modifications to the executor sleep time calculation and tests