changeset 8036:0032f33fdc47

7058832: com/sun/net/httpserver/bugs/B6373555.java failing intermittently Reviewed-by: alanb
author igerasim
date Fri, 29 Aug 2014 17:13:47 +0400
parents 353c0eb4aace
children 87ff88fdd832 866ce3916733
files test/com/sun/net/httpserver/bugs/B6373555.java
diffstat 1 files changed, 1 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/test/com/sun/net/httpserver/bugs/B6373555.java	Thu Aug 28 18:01:16 2014 +0100
+++ b/test/com/sun/net/httpserver/bugs/B6373555.java	Fri Aug 29 17:13:47 2014 +0400
@@ -43,14 +43,12 @@
     private static int port;
 
     private static volatile boolean error = false;
-    private static Object lock;
     static HttpServer httpServer;
     static ExecutorService pool, execs;
     static int NUM = 1000;
 
     public static void main(String[] args) throws Exception {
         try {
-            lock = new Object();
             if (args.length > 0) {
                 NUM = Integer.parseInt (args[0]);
             }
@@ -117,12 +115,6 @@
                     System.out.println("Doesn't match");
                     error = true;
                 }
-                synchronized(lock) {
-                    ++received;
-                    if ((received % 1000) == 0) {
-                        System.out.println("Received="+received);
-                    }
-                }
             }
             catch(Exception e) {
                 e.printStackTrace();
@@ -150,18 +142,12 @@
     private static HttpServer createHttpServer(ExecutorService execs)
         throws Exception {
         InetSocketAddress inetAddress = new InetSocketAddress(0);
-        HttpServer testServer = HttpServer.create(inetAddress, 5);
+        HttpServer testServer = HttpServer.create(inetAddress, 15);
         testServer.setExecutor(execs);
         HttpContext context = testServer.createContext("/test");
         context.setHandler(new HttpHandler() {
             public void handle(HttpExchange msg) {
                 try {
-                    synchronized(lock) {
-                        ++s_received;
-                            if ((s_received % 1000) == 0) {
-                            System.out.println("Received="+s_received);
-                        }
-                    }
                     String method = msg.getRequestMethod();
                         if (method.equals("POST")) {
                         InputStream is = msg.getRequestBody();
@@ -172,12 +158,6 @@
                         System.out.println("****** METHOD not handled ***** "+method);
                             System.out.println("Received="+s_received);
                     }
-                    synchronized(lock) {
-                        ++sent;
-                            if ((sent % 1000) == 0) {
-                            System.out.println("sent="+sent);
-                        }
-                    }
                 }
                 catch(Exception e) {
                     e.printStackTrace();