JFTR allow_query serve-stale rpzrecurse have already been modify to run in parallel. Note: I think the random port allocation is enough for the tests, but if you want to make it more robust a script that would lock, allocate, check the port, unlock should be made. But I strongly believe it's not necessary for low number of tests and 32k ports available.