}
// Use separate ports between netty and non-netty because netty might take a while to close them
int port = PORT + (useNetty ? 1 : 0);
NodeScript script = env.createScript("server.js", new File("./target/test-classes/argo/server.js"),
new String[] { String.valueOf(port) });
ScriptFuture scriptFuture = script.execute();
System.out.println("Waiting for the port to open. useNetty = " + useNetty);
Utils.awaitPortOpen(port);
System.out.println("Port " + port + " is open");
Utils.getString(BASEURL + port + "/forecastrss?p=08904", 200);
scriptFuture.cancel(true);
try {
scriptFuture.get();
} catch (CancellationException ok) {
}
System.out.println("Server has stopped");
}