Put test code into a thread.