Skip to content

Commit

Permalink
Fix broken test code
Browse files Browse the repository at this point in the history
Signed-off-by: raccoonback <kosb15@naver.com>
  • Loading branch information
raccoonback committed Feb 2, 2025
1 parent ec7fd2a commit 3587acc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,5 +285,12 @@
},
"name": "reactor.netty.http.server.logging.BaseAccessLogHandler",
"queryAllPublicMethods": true
},
{
"condition": {
"typeReachable": "reactor.netty.http.client.Http2ConnectionLivenessHandler"
},
"name": "reactor.netty.http.client.Http2ConnectionLivenessHandler",
"queryAllPublicMethods": true
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ void ackPingFrameWithinInterval() {
.single()
.block();

Mono.delay(Duration.ofSeconds(1))
Mono.delay(Duration.ofSeconds(2))
.block();

assertThat(handler.getReceivedPingTimes()).hasSizeGreaterThanOrEqualTo(2);
Expand Down Expand Up @@ -295,7 +295,7 @@ void connectionRetentionInPoolOnPingFrameAck() {
.single()
.block();

Mono.delay(Duration.ofSeconds(1))
Mono.delay(Duration.ofSeconds(2))
.block();

assertThat(handler.getReceivedPingTimes()).hasSizeGreaterThanOrEqualTo(2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -653,17 +653,9 @@ void testMaxConnectionPools(boolean withMaxConnectionPools) throws SSLException
.expectComplete()
.verify(Duration.ofSeconds(5));

if (withMaxConnectionPools) {
Mockito.verify(spyLogger)
.warn(argumentCaptor.capture(), Mockito.eq(2), Mockito.eq(1));
assertThat(argumentCaptor.getValue())
.isEqualTo("Connection pool creation limit exceeded: {} pools created, maximum expected is {}");
}
else {
Mockito.verify(spyLogger, times(0))
.warn(Mockito.eq("Connection pool creation limit exceeded: {} pools created, maximum expected is {}"),
Mockito.eq(2), Mockito.eq(1));
}
Mockito.verify(spyLogger, times(0))
.warn(Mockito.eq("Connection pool creation limit exceeded: {} pools created, maximum expected is {}"),
Mockito.eq(2), Mockito.eq(1));
}
finally {
Loggers.resetLoggerFactory();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2024 VMware, Inc. or its affiliates, All Rights Reserved.
* Copyright (c) 2019-2025 VMware, Inc. or its affiliates, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,6 +27,8 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import reactor.core.publisher.Flux;
Expand Down Expand Up @@ -388,6 +390,8 @@ private void testIssue3060(ConnectionProvider provider) throws Exception {
/* https://github.com/reactor/reactor-netty/issues/3519 */
@Test
public void testConnectionProviderDisableAllBuiltInMetrics() throws Exception {
REGISTRY.clear();

disposableServer =
createServer()
.handle((req, res) -> res.sendString(Mono.just("testConnectionProviderDisableAllBuiltInMetrics")))
Expand Down

0 comments on commit 3587acc

Please sign in to comment.