Skip to content

Commit

Permalink
Merge #2562 into 2.0.0-M3
Browse files Browse the repository at this point in the history
  • Loading branch information
violetagg committed Nov 3, 2022
2 parents 996d8a8 + 58c021d commit a2a3bdc
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 2 deletions.
1 change: 0 additions & 1 deletion reactor-netty5-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ dependencies {
testRuntimeOnly "org.junit.platform:junit-platform-launcher:$junitPlatformLauncherVersion"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
testRuntimeOnly "org.slf4j:jcl-over-slf4j:$slf4jVersion"
testRuntimeOnly "io.micrometer:micrometer-tracing:$micrometerTracingVersion"

// https://github.com/netty/netty/pull/11487
// https://github.com/netty/netty/issues/10317
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package reactor.netty5.tcp;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.assertj.core.api.Assertions.fail;
import static reactor.netty5.Metrics.CONNECTIONS_TOTAL;
import static reactor.netty5.Metrics.CONNECT_TIME;
Expand Down Expand Up @@ -222,6 +223,12 @@ void testContextAwareRecorder() throws Exception {
assertThat(recorder.onDataSentContextView).isTrue();
}

@Test
void smokeTestNoContextPropagation() {
assertThatExceptionOfType(ClassNotFoundException.class)
.isThrownBy(() -> Class.forName("io.micrometer.context.ContextRegistry"));
}

private void checkExpectationsPositive() {
InetSocketAddress ca = (InetSocketAddress) connection.channel().localAddress();
String clientAddress = ca.getHostString() + ":" + ca.getPort();
Expand Down
4 changes: 3 additions & 1 deletion reactor-netty5-http/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ dependencies {
testImplementation "io.projectreactor.tools:blockhound-junit-platform:$blockHoundVersion"
testImplementation "io.micrometer:micrometer-core:$micrometerVersion"
testImplementation "io.micrometer:micrometer-test:$micrometerVersion"
testImplementation "io.micrometer:micrometer-tracing-integration-test:$micrometerTracingVersion"
testImplementation("io.micrometer:micrometer-tracing-integration-test:$micrometerTracingVersion") {
exclude module: "context-propagation"
}
testImplementation "io.netty.contrib:netty-codec-extras:$nettyContribVersion"
testImplementation "org.reflections:reflections:$reflectionsVersion"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;

/**
* @author Simon Baslé
Expand All @@ -57,6 +58,12 @@ void smokeTestNoMicrometer() {
assertThat(Metrics.isMicrometerAvailable()).as("isMicrometerAvailable").isFalse();
}

@Test
void smokeTestNoContextPropagation() {
assertThatExceptionOfType(ClassNotFoundException.class)
.isThrownBy(() -> Class.forName("io.micrometer.context.ContextRegistry"));
}

@Test
void clientCreatedWithMetricsDoesntLoadGaugeHttp1() {
ConnectionProvider provider =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
import java.util.stream.Stream;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static reactor.netty5.Metrics.CONNECTIONS_ACTIVE;
import static reactor.netty5.Metrics.CONNECTIONS_TOTAL;
import static reactor.netty5.Metrics.CONNECT_TIME;
Expand Down Expand Up @@ -778,6 +779,12 @@ void testBadRequest(HttpProtocol[] serverProtocols, HttpProtocol[] clientProtoco
checkExpectationsBadRequest(sa.getHostString() + ":" + sa.getPort(), serverCtx != null);
}

@Test
void smokeTestNoContextPropagation() {
assertThatExceptionOfType(ClassNotFoundException.class)
.isThrownBy(() -> Class.forName("io.micrometer.context.ContextRegistry"));
}

private void checkServerConnectionsMicrometer(HttpServerRequest request) {
String address = formatSocketAddress(request.hostAddress());
boolean isHttp2 = request.requestHeaders().contains(HttpConversionUtil.ExtensionHeaderNames.SCHEME.text());
Expand Down

0 comments on commit a2a3bdc

Please sign in to comment.