Add test to check the number of threads.