Improve error message when scheduler cannot find a slot for immediate scheduling.
Improve robustness of task manager test