add thread detach to env_test.