I started to run into this issue a couple of days ago where local Jest tests using the Twig Renderer randomly started to hang before eventually crashing my entire computer.
After this happened 5+ times, I did some digging and think I've found the problem + came up with a fix...
Essentially the problem was that getPort couldn't find any "available, previously unused" ports because old PHP instances (the port previously assigned) aren't cleared out of the cache that gets created and saved locally.
Fix coming soon!