Fixing a race condition in a test
Used TestScheduler to fix the unit test