phrocker commented on a change in pull request #554: MINIFICPP-842 - CivetWeb
tests should use random port
URL: https://github.com/apache/nifi-minifi-cpp/pull/554#discussion_r284241570
##########
File path: extensions/civetweb/processors/ListenHTTP.cpp
##########
@@ -191,6 +211,16 @@ void ListenHTTP::onSchedule(core::ProcessContext
*context, core::ProcessSessionF
server_.reset(new CivetServer(options));
handler_.reset(new Handler(basePath, context, sessionFactory,
std::move(authDNPattern), std::move(headersAsAttributesPattern)));
server_->addHandler(basePath, handler_.get());
+
+ if (randomPort) {
+ const auto& vec = server_->getListeningPorts();
+ if (vec.size() != 1) {
+ logger_->log_error("Random port is set, but there is no listening port!
Server most probably failed to start!");
Review comment:
If this is listening on http and https and a test will use either/both how
will it know those random ports?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services