Consolidate random port finding for specs