Added test for task count tracking when delayed tasks are involved