[MRG] wait for ports to be listening before starting tests