[Error] Could not terminate pathfinding thread[0] in 200ms, trying Thread.Abort During Unit Test

We have some unit tests that load, and unload, an environment that includes an A* pathfinding setup.

Functionally speaking everything seems to check out. But occasionally the package throws this error seemingly while the environment is unloaded.

[Error] Could not terminate pathfinding thread[0] in 200ms, trying Thread.Abort

It happens seemingly randomly, I suspect something to do with the test runner trying to move through out the tests might just be tripping some internal logic. I’m not certain.

It has recently started happening more frequently, though still not 100% of the time. This error only pops up during Unit Test runs, we’ve not seen it in an actual game scenario.

A way to disable this error gracefully would be nice–I am at the point where locally I am planning to just simply comment out the error. However I don’t understand necessarily the ramifications of this, maybe I’d be hiding something pretty dire/important for debugging later if I did this.

I’ve seen a few threads about this sort of error exist but it sounds like you often hit a wall at getting to see it more closely yourself. Happy to provide what info I can. This fails in different tests but the setup of the pathfinding objects is the same each time, we have a 1k x 1k grid graph with anywhere from 3-10 agents on it at a time. The t est runner might be trying to create and destroy these faster than the system is processing. Unity’s test runner with async code has been particularly thorny!

To sum up:

  1. What risks are run by simply disabling this error?
  2. An easy way to disable it via code would let us handle this without having to modify the source of the package directly and keep future updates straightforward if need be.