Commafeed starter - #171
Conversation
| /jdk_21_maven/cs/rest/person-controller/target/ | ||
| /jdk_21_maven/em/embedded/rest/person-controller/target/ | ||
| /jdk_21_maven/em/external/rest/person-controller/target/ | ||
| /jdk_25_maven/em/external/rest/commafeed/target/ |
There was a problem hiding this comment.
what about the the target folders of the API itself?
| // Quarkus.run() blocks until shutdown, so it needs its own thread. | ||
| Thread thread = new Thread(() -> Quarkus.run(), "quarkus-sut"); | ||
| thread.setDaemon(true); | ||
| thread.start(); |
There was a problem hiding this comment.
are we sure the thread will be killed when needed?
There was a problem hiding this comment.
Quarkus.blockingExit() kills that thread.
|
|
||
| @Override | ||
| public void stopSut() { | ||
| Quarkus.blockingExit(); |
There was a problem hiding this comment.
will this stop/interrupt the manually started thread above?
There was a problem hiding this comment.
yes, I tested it.
| try (ServerSocket socket = new ServerSocket(0)) { | ||
| socket.setReuseAddress(true); | ||
| return socket.getLocalPort(); | ||
| } catch (IOException e) { |
There was a problem hiding this comment.
how is this working? aren't you opening a port here? and then that would be no longer free? also, even if close it, might take a while before OS makes it available again... doesn't Quarkus have a system to dirctly bind on 0 and retrieve what chose by it? (like Spring)
There was a problem hiding this comment.
I found a better way to start, but after starting sut, I had to use reflections to get the port number.
| Liveness of the thread we started is NOT a usable signal: Quarkus.run() hands the | ||
| application over to its own "Quarkus Main Thread" and returns immediately. Poll the port. | ||
| */ | ||
| private void waitUntilListening() { |
There was a problem hiding this comment.
these seem very general functionality. if those indeed needed here, we should rather put them under client-java/controller, and call it here as library
There was a problem hiding this comment.
I updated my approach so that we no longer need this function.
No description provided.