Fix thread test