better state checks, retry getNewTasks after adding one
Make test function wait random time to show multi-tasks working properly