GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Await termination of SslHandler executor (#16138) · netty/netty@eaf46b8

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • handler/src/test/java/io/netty/handler/ssl
    • CipherSuiteCanaryTest.java
    • DelayingExecutor.java
    • OpenSslPrivateKeyMethodTest.java
    • SSLEngineTest.java
    • SslHandlerTest.java
  • testsuite/src/main/java/io/netty/testsuite/transport/socket
    • SocketSslClientRenegotiateTest.java
    • SocketSslEchoTest.java
    • SocketSslGreetingTest.java
  • transport-blockhound-tests/src/test/java/io/netty/util/internal
    • NettyBlockHoundIntegrationTest.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎handler/src/test/java/io/netty/handler/ssl/CipherSuiteCanaryTest.java‎

Copy file name to clipboardExpand all lines: handler/src/test/java/io/netty/handler/ssl/CipherSuiteCanaryTest.java
+5-4Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,16 +232,17 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause)
232232
}
233233
} finally {
234234
server.close().sync();
235+
236+
if (executorService != null) {
237+
executorService.shutdown();
238+
assertTrue(executorService.awaitTermination(5, TimeUnit.SECONDS));
239+
}
235240
}
236241
} finally {
237242
ReferenceCountUtil.release(sslClientContext);
238243
}
239244
} finally {
240245
ReferenceCountUtil.release(sslServerContext);
241-
242-
if (executorService != null) {
243-
executorService.shutdown();
244-
}
245246
}
246247
}
247248

Collapse file

‎handler/src/test/java/io/netty/handler/ssl/DelayingExecutor.java‎

Copy file name to clipboardExpand all lines: handler/src/test/java/io/netty/handler/ssl/DelayingExecutor.java
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public void execute(Runnable command) {
4141
ThreadLocalRandom.current().nextInt(100), TimeUnit.MILLISECONDS);
4242
}
4343

44-
void shutdown() {
44+
boolean shutdownAndAwaitTermination(long timeout, TimeUnit unit) throws InterruptedException {
4545
service.shutdown();
46+
return service.awaitTermination(timeout, unit);
4647
}
4748
}
Collapse file

‎handler/src/test/java/io/netty/handler/ssl/OpenSslPrivateKeyMethodTest.java‎

Copy file name to clipboardExpand all lines: handler/src/test/java/io/netty/handler/ssl/OpenSslPrivateKeyMethodTest.java
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ public Thread newThread(Runnable r) {
114114
}
115115

116116
@AfterAll
117-
public static void destroy() {
117+
public static void destroy() throws InterruptedException {
118118
if (OpenSsl.isBoringSSL() || OpenSsl.isAWSLC()) {
119119
GROUP.shutdownGracefully();
120-
EXECUTOR.shutdown();
120+
assertTrue(EXECUTOR.shutdownAndAwaitTermination(5, TimeUnit.SECONDS));
121121
}
122122
}
123123

Collapse file

‎handler/src/test/java/io/netty/handler/ssl/SSLEngineTest.java‎

Copy file name to clipboardExpand all lines: handler/src/test/java/io/netty/handler/ssl/SSLEngineTest.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ public void tearDown() throws InterruptedException {
550550
if (clientGroupShutdownFuture != null) {
551551
clientGroupShutdownFuture.sync();
552552
}
553-
delegatingExecutor.shutdown();
553+
assertTrue(delegatingExecutor.shutdownAndAwaitTermination(5, TimeUnit.SECONDS));
554554
serverException = null;
555555
clientException = null;
556556
}
Collapse file

‎handler/src/test/java/io/netty/handler/ssl/SslHandlerTest.java‎

Copy file name to clipboardExpand all lines: handler/src/test/java/io/netty/handler/ssl/SslHandlerTest.java
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ public void testHandshakeWithExecutorJDK() throws Throwable {
994994
try {
995995
testHandshakeWithExecutor(executorService, SslProvider.JDK, false);
996996
} finally {
997-
executorService.shutdown();
997+
assertTrue(executorService.shutdownAndAwaitTermination(5, TimeUnit.SECONDS));
998998
}
999999
}
10001000

@@ -1023,7 +1023,7 @@ public void testHandshakeWithExecutorOpenSsl() throws Throwable {
10231023
try {
10241024
testHandshakeWithExecutor(executorService, SslProvider.OPENSSL, false);
10251025
} finally {
1026-
executorService.shutdown();
1026+
assertTrue(executorService.shutdownAndAwaitTermination(5, TimeUnit.SECONDS));
10271027
}
10281028
}
10291029

@@ -1048,7 +1048,7 @@ public void testHandshakeMTLSWithExecutorJDK() throws Throwable {
10481048
try {
10491049
testHandshakeWithExecutor(executorService, SslProvider.JDK, true);
10501050
} finally {
1051-
executorService.shutdown();
1051+
assertTrue(executorService.shutdownAndAwaitTermination(5, TimeUnit.SECONDS));
10521052
}
10531053
}
10541054

@@ -1077,7 +1077,7 @@ public void testHandshakeMTLSWithExecutorOpenSsl() throws Throwable {
10771077
try {
10781078
testHandshakeWithExecutor(executorService, SslProvider.OPENSSL, true);
10791079
} finally {
1080-
executorService.shutdown();
1080+
assertTrue(executorService.shutdownAndAwaitTermination(5, TimeUnit.SECONDS));
10811081
}
10821082
}
10831083

Collapse file

‎testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketSslClientRenegotiateTest.java‎

Copy file name to clipboardExpand all lines: testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketSslClientRenegotiateTest.java
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ public void initChannel(Channel sch) throws Exception {
206206
} finally {
207207
if (executorService != null) {
208208
executorService.shutdown();
209+
assertTrue(executorService.awaitTermination(5, TimeUnit.SECONDS));
209210
}
210211
}
211212
}
Collapse file

‎testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketSslEchoTest.java‎

Copy file name to clipboardExpand all lines: testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketSslEchoTest.java
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ public void userEventTriggered(ChannelHandlerContext ctx, Object evt) {
385385
clientChannel.close().awaitUninterruptibly();
386386
sc.close().awaitUninterruptibly();
387387
delegatedTaskExecutor.shutdown();
388+
assertTrue(delegatedTaskExecutor.awaitTermination(5, TimeUnit.SECONDS));
388389

389390
if (serverException.get() != null && !(serverException.get() instanceof IOException)) {
390391
throw serverException.get();
Collapse file

‎testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketSslGreetingTest.java‎

Copy file name to clipboardExpand all lines: testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketSslGreetingTest.java
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858

5959
import static org.junit.jupiter.api.Assertions.assertEquals;
6060
import static org.junit.jupiter.api.Assertions.assertFalse;
61+
import static org.junit.jupiter.api.Assertions.assertTrue;
6162
import static org.junit.jupiter.api.Assertions.fail;
6263

6364
public class SocketSslGreetingTest extends AbstractSocketTest {
@@ -183,6 +184,7 @@ public void initChannel(Channel sch) throws Exception {
183184
} finally {
184185
if (executorService != null) {
185186
executorService.shutdown();
187+
assertTrue(executorService.awaitTermination(5, TimeUnit.SECONDS));
186188
}
187189
}
188190
}
Collapse file

‎transport-blockhound-tests/src/test/java/io/netty/util/internal/NettyBlockHoundIntegrationTest.java‎

Copy file name to clipboardExpand all lines: transport-blockhound-tests/src/test/java/io/netty/util/internal/NettyBlockHoundIntegrationTest.java
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ public void testHandshakeWithExecutor() throws Exception {
255255
testHandshakeWithExecutor(executorService, "TLSv1.2");
256256
} finally {
257257
executorService.shutdown();
258+
assertTrue(executorService.awaitTermination(5, TimeUnit.SECONDS));
258259
}
259260
}
260261

@@ -266,6 +267,7 @@ public void testHandshakeWithExecutorTLSv13() throws Exception {
266267
testHandshakeWithExecutor(executorService, "TLSv1.3");
267268
} finally {
268269
executorService.shutdown();
270+
assertTrue(executorService.awaitTermination(5, TimeUnit.SECONDS));
269271
}
270272
}
271273

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.