Skip to content

Commit

Permalink
Trying a fixed port 8080 for travis
Browse files Browse the repository at this point in the history
  • Loading branch information
ajsquared committed Mar 23, 2016
1 parent 0c256d0 commit c63c1ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private ProfilerServer() { }
public static void startServer(final Map<String, ScheduledFuture<?>> runningProfilers, final Map<String, Profiler> activeProfilers, final int port, final AtomicReference<Boolean> isRunning, final List<String> errors) {
final HttpServer server = VERTX.createHttpServer();
server.requestHandler(RequestHandler.getMatcher(runningProfilers, activeProfilers, isRunning, errors));
server.listen(port, "0.0.0.0", new Handler<AsyncResult<HttpServer>>() {
server.listen(port, new Handler<AsyncResult<HttpServer>>() {
@Override
public void handle(AsyncResult<HttpServer> event) {
if (event.failed()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import org.junit.Test;

import java.io.IOException;
import java.net.ServerSocket;
import java.util.*;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
Expand All @@ -45,9 +44,7 @@ public void setup() throws IOException {
activeProfilers.put("MockProfiler1", profiler1);
activeProfilers.put("MockProfiler2", profiler2);

ServerSocket s = new ServerSocket(0); // This gives us a random open port
port = s.getLocalPort();
s.close();
port = 8080;

isRunning = new AtomicReference<>(true);
errors = new ArrayList<>();
Expand Down Expand Up @@ -104,7 +101,7 @@ public void testIsRunning() throws IOException {
}

private void httpRequestTest(String path, String expectedBody) throws IOException {
HttpRequestBase get = new HttpGet(String.format("http://0.0.0.0:%d/%s", port, path));
HttpRequestBase get = new HttpGet(String.format("http://localhost:%d/%s", port, path));
CloseableHttpResponse response = client.execute(get);

int statusCode = response.getStatusLine().getStatusCode();
Expand Down

0 comments on commit c63c1ea

Please sign in to comment.