--- a/test/jdk/java/net/CookieHandler/LocalHostCookie.java Thu Oct 17 20:27:44 2019 +0100
+++ b/test/jdk/java/net/CookieHandler/LocalHostCookie.java Thu Oct 17 20:53:35 2019 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,13 +28,16 @@
import java.net.*;
import java.util.List;
import java.util.Map;
-import java.util.concurrent.Executors;
+import static java.net.Proxy.NO_PROXY;
/*
* @test
* @bug 7169142
+ * @key intermittent
* @modules jdk.httpserver
- * @summary CookieHandler does not work with localhost
+ * @summary CookieHandler does not work with localhost. This requires
+ * binding to the wildcard address and might fail intermittently
+ * due to port reuse issues.
* @run main/othervm LocalHostCookie
*/
public class LocalHostCookie {
@@ -49,7 +52,7 @@
s = new Server();
s.startServer();
URL url = new URL("http","localhost", s.getPort(), "/");
- HttpURLConnection urlConnection = (HttpURLConnection)url.openConnection();
+ HttpURLConnection urlConnection = (HttpURLConnection)url.openConnection(NO_PROXY);
urlConnection.setRequestMethod("GET");
urlConnection.setDoOutput(true);
urlConnection.connect();
@@ -126,4 +129,3 @@
}
}
}
-