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@ba00ff8

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
@@ -223,16 +223,17 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause)
223223
}
224224
} finally {
225225
server.close().sync();
226+
227+
if (executorService != null) {
228+
executorService.shutdown();
229+
assertTrue(executorService.awaitTermination(5, TimeUnit.SECONDS));
230+
}
226231
}
227232
} finally {
228233
ReferenceCountUtil.release(sslClientContext);
229234
}
230235
} finally {
231236
ReferenceCountUtil.release(sslServerContext);
232-
233-
if (executorService != null) {
234-
executorService.shutdown();
235-
}
236237
}
237238
}
238239

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
@@ -42,7 +42,8 @@ public void execute(Runnable command) {
4242
PlatformDependent.threadLocalRandom().nextInt(100), TimeUnit.MILLISECONDS);
4343
}
4444

45-
void shutdown() {
45+
boolean shutdownAndAwaitTermination(long timeout, TimeUnit unit) throws InterruptedException {
4646
service.shutdown();
47+
return service.awaitTermination(timeout, unit);
4748
}
4849
}
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-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@
5858
import java.util.Collections;
5959
import java.util.List;
6060
import java.util.concurrent.Executor;
61-
import java.util.concurrent.ExecutorService;
62-
import java.util.concurrent.Executors;
6361
import java.util.concurrent.ThreadFactory;
6462
import java.util.concurrent.TimeUnit;
6563
import java.util.concurrent.atomic.AtomicBoolean;
@@ -110,11 +108,11 @@ public Thread newThread(Runnable r) {
110108
}
111109

112110
@AfterAll
113-
public static void destroy() {
111+
public static void destroy() throws InterruptedException {
114112
if (OpenSsl.isBoringSSL() || OpenSsl.isAWSLC()) {
115113
GROUP.shutdownGracefully();
116114
CERT.delete();
117-
EXECUTOR.shutdown();
115+
assertTrue(EXECUTOR.shutdownAndAwaitTermination(5, TimeUnit.SECONDS));
118116
}
119117
}
120118

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
@@ -547,7 +547,7 @@ public void tearDown() throws InterruptedException {
547547
if (clientGroupShutdownFuture != null) {
548548
clientGroupShutdownFuture.sync();
549549
}
550-
delegatingExecutor.shutdown();
550+
assertTrue(delegatingExecutor.shutdownAndAwaitTermination(5, TimeUnit.SECONDS));
551551
serverException = null;
552552
clientException = null;
553553
}
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
@@ -1000,7 +1000,7 @@ public void testHandshakeWithExecutorJDK() throws Throwable {
10001000
try {
10011001
testHandshakeWithExecutor(executorService, SslProvider.JDK, false);
10021002
} finally {
1003-
executorService.shutdown();
1003+
assertTrue(executorService.shutdownAndAwaitTermination(5, TimeUnit.SECONDS));
10041004
}
10051005
}
10061006

@@ -1029,7 +1029,7 @@ public void testHandshakeWithExecutorOpenSsl() throws Throwable {
10291029
try {
10301030
testHandshakeWithExecutor(executorService, SslProvider.OPENSSL, false);
10311031
} finally {
1032-
executorService.shutdown();
1032+
assertTrue(executorService.shutdownAndAwaitTermination(5, TimeUnit.SECONDS));
10331033
}
10341034
}
10351035

@@ -1054,7 +1054,7 @@ public void testHandshakeMTLSWithExecutorJDK() throws Throwable {
10541054
try {
10551055
testHandshakeWithExecutor(executorService, SslProvider.JDK, true);
10561056
} finally {
1057-
executorService.shutdown();
1057+
assertTrue(executorService.shutdownAndAwaitTermination(5, TimeUnit.SECONDS));
10581058
}
10591059
}
10601060

@@ -1083,7 +1083,7 @@ public void testHandshakeMTLSWithExecutorOpenSsl() throws Throwable {
10831083
try {
10841084
testHandshakeWithExecutor(executorService, SslProvider.OPENSSL, true);
10851085
} finally {
1086-
executorService.shutdown();
1086+
assertTrue(executorService.shutdownAndAwaitTermination(5, TimeUnit.SECONDS));
10871087
}
10881088
}
10891089

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
@@ -381,6 +381,7 @@ public void userEventTriggered(ChannelHandlerContext ctx, Object evt) {
381381
clientChannel.close().awaitUninterruptibly();
382382
sc.close().awaitUninterruptibly();
383383
delegatedTaskExecutor.shutdown();
384+
assertTrue(delegatedTaskExecutor.awaitTermination(5, TimeUnit.SECONDS));
384385

385386
if (serverException.get() != null && !(serverException.get() instanceof IOException)) {
386387
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 {
@@ -179,6 +180,7 @@ public void initChannel(Channel sch) throws Exception {
179180
} finally {
180181
if (executorService != null) {
181182
executorService.shutdown();
183+
assertTrue(executorService.awaitTermination(5, TimeUnit.SECONDS));
182184
}
183185
}
184186
}
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
@@ -250,6 +250,7 @@ public void testHandshakeWithExecutor() throws Exception {
250250
testHandshakeWithExecutor(executorService, "TLSv1.2");
251251
} finally {
252252
executorService.shutdown();
253+
assertTrue(executorService.awaitTermination(5, TimeUnit.SECONDS));
253254
}
254255
}
255256

@@ -261,6 +262,7 @@ public void testHandshakeWithExecutorTLSv13() throws Exception {
261262
testHandshakeWithExecutor(executorService, "TLSv1.3");
262263
} finally {
263264
executorService.shutdown();
265+
assertTrue(executorService.awaitTermination(5, TimeUnit.SECONDS));
264266
}
265267
}
266268

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.