--- old/test/jdk/sun/net/www/http/HttpClient/MultiThreadTest.java 2018-09-27 11:15:28.601613982 +0100 +++ new/test/jdk/sun/net/www/http/HttpClient/MultiThreadTest.java 2018-09-27 11:15:28.217622793 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, 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 @@ -39,13 +39,16 @@ import java.net.*; import java.io.*; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; public class MultiThreadTest extends Thread { /* * Is debugging enabled - start with -d to enable. */ - static boolean debug = false; + static boolean debug = true; // disable debug once stability proven static Object threadlock = new Object (); static int threadCounter = 0; @@ -94,6 +97,8 @@ } public void run () { + long start = System.nanoTime(); + try { for (int i=0; i workers = new ArrayList<>(); Server(ServerSocket ss) { this.ss = ss; } + public synchronized List workers() { + return workers; + } + public synchronized int connectionCount() { return connectionCount; } @@ -203,11 +220,12 @@ } int id; + Worker w; synchronized (this) { id = connectionCount++; + w = new Worker(s, id); + workers.add(w); } - - Worker w = new Worker(s, id); w.start(); MultiThreadTest.debug("server: Started worker " + id); } @@ -268,6 +286,8 @@ } public void run() { + long start = System.nanoTime(); + try { int max = 400; byte b[] = new byte[1000]; @@ -318,6 +338,8 @@ try { s.close(); } catch (Exception e) { } + MultiThreadTest.debug("worker: " + id + " end - " + + Duration.ofNanos(System.nanoTime() - start)); } } }