fix tests to get port from the listener, too