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) (#16141) · netty/netty@1155c46

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
@@ -546,7 +546,7 @@ public void tearDown() throws InterruptedException {
546546
if (clientGroupShutdownFuture != null) {
547547
clientGroupShutdownFuture.sync();
548548
}
549-
delegatingExecutor.shutdown();
549+
assertTrue(delegatingExecutor.shutdownAndAwaitTermination(5, TimeUnit.SECONDS));
550550
serverException = null;
551551
clientException = null;
552552
}
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
@@ -995,7 +995,7 @@ public void testHandshakeWithExecutorJDK() throws Throwable {
995995
try {
996996
testHandshakeWithExecutor(executorService, SslProvider.JDK, false);
997997
} finally {
998-
executorService.shutdown();
998+
assertTrue(executorService.shutdownAndAwaitTermination(5, TimeUnit.SECONDS));
999999
}
10001000
}
10011001

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

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

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

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
@@ -205,6 +205,7 @@ public void initChannel(Channel sch) throws Exception {
205205
} finally {
206206
if (executorService != null) {
207207
executorService.shutdown();
208+
assertTrue(executorService.awaitTermination(5, TimeUnit.SECONDS));
208209
}
209210
}
210211
}
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
@@ -383,6 +383,7 @@ public void userEventTriggered(ChannelHandlerContext ctx, Object evt) {
383383
clientChannel.close().awaitUninterruptibly();
384384
sc.close().awaitUninterruptibly();
385385
delegatedTaskExecutor.shutdown();
386+
assertTrue(delegatedTaskExecutor.awaitTermination(5, TimeUnit.SECONDS));
386387

387388
if (serverException.get() != null && !(serverException.get() instanceof IOException)) {
388389
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
@@ -253,6 +253,7 @@ public void testHandshakeWithExecutor() throws Exception {
253253
testHandshakeWithExecutor(executorService, "TLSv1.2");
254254
} finally {
255255
executorService.shutdown();
256+
assertTrue(executorService.awaitTermination(5, TimeUnit.SECONDS));
256257
}
257258
}
258259

@@ -264,6 +265,7 @@ public void testHandshakeWithExecutorTLSv13() throws Exception {
264265
testHandshakeWithExecutor(executorService, "TLSv1.3");
265266
} finally {
266267
executorService.shutdown();
268+
assertTrue(executorService.awaitTermination(5, TimeUnit.SECONDS));
267269
}
268270
}
269271

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.