Added tests for the thread scheduler