File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
src/java.base/share/classes/sun/net/www/http
test/jdk/sun/net/www/http/KeepAliveCache Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 30
30
import sun .net .NetProperties ;
31
31
import java .security .AccessController ;
32
32
import java .security .PrivilegedAction ;
33
+ import java .util .concurrent .TimeUnit ;
33
34
import java .util .concurrent .locks .Condition ;
34
35
import java .util .concurrent .locks .ReentrantLock ;
35
36
@@ -115,7 +116,7 @@ public void run()
115
116
long before = System .currentTimeMillis ();
116
117
long timeout = TIMEOUT ;
117
118
while ((kace = poll ()) == null ) {
118
- waiter .wait (timeout );
119
+ waiter .await (timeout , TimeUnit . MILLISECONDS );
119
120
120
121
long after = System .currentTimeMillis ();
121
122
long elapsed = after - before ;
Original file line number Diff line number Diff line change 23
23
24
24
/*
25
25
* @test
26
- * @bug 5045306 6356004 6993490
26
+ * @bug 5045306 6356004 6993490 8255124
27
27
* @modules java.base/sun.net.www
28
28
* java.management
29
29
* @library ../../httptest/
35
35
import java .net .*;
36
36
import java .io .*;
37
37
import java .lang .management .*;
38
+ import java .util .ArrayList ;
39
+ import java .util .List ;
38
40
39
41
/* Part 1:
40
42
* The http client makes a connection to a URL whos content contains a lot of
@@ -69,6 +71,10 @@ public static void startHttpServer() {
69
71
}
70
72
71
73
public static void clientHttpCalls () {
74
+ List <Throwable > uncaught = new ArrayList <>();
75
+ Thread .setDefaultUncaughtExceptionHandler ((t , ex ) -> {
76
+ uncaught .add (ex );
77
+ });
72
78
try {
73
79
System .out .println ("http server listen on: " + server .getLocalPort ());
74
80
String hostAddr = InetAddress .getLocalHost ().getHostAddress ();
@@ -133,6 +139,9 @@ public static void clientHttpCalls() {
133
139
} finally {
134
140
server .terminate ();
135
141
}
142
+ if (!uncaught .isEmpty ()) {
143
+ throw new RuntimeException ("Unhandled exception:" , uncaught .get (0 ));
144
+ }
136
145
}
137
146
}
138
147
You can’t perform that action at this time.
0 commit comments