fixed thread-safety issue in test_runner