Skip to content

Commit 2f6b5c6

Browse files
committed
cleanup
1 parent c6e7e42 commit 2f6b5c6

5 files changed

Lines changed: 67 additions & 88 deletions

File tree

instrumentation/apache-dubbo-2.7/testing/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.java

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ void testDubboChain() throws ReflectiveOperationException {
202202
span.hasName("org.apache.dubbo.rpc.service.GenericService/$invoke")
203203
.hasKind(SpanKind.CLIENT)
204204
.hasParent(trace.getSpan(0))
205-
.hasAttributesSatisfyingExactly(attrs.toArray(new AttributeAssertion[0]));
205+
.hasAttributesSatisfyingExactly(attrs);
206206
},
207207
span -> {
208208
List<AttributeAssertion> attrs = new ArrayList<>();
@@ -217,7 +217,7 @@ void testDubboChain() throws ReflectiveOperationException {
217217
"io.opentelemetry.instrumentation.apachedubbo.v2_7.api.MiddleService/hello")
218218
.hasKind(SpanKind.SERVER)
219219
.hasParent(trace.getSpan(1))
220-
.hasAttributesSatisfying(attrs.toArray(new AttributeAssertion[0]));
220+
.hasAttributesSatisfying(attrs);
221221
},
222222
span -> {
223223
List<AttributeAssertion> attrs = new ArrayList<>();
@@ -241,7 +241,7 @@ void testDubboChain() throws ReflectiveOperationException {
241241
span.hasName("org.apache.dubbo.rpc.service.GenericService/$invoke")
242242
.hasKind(SpanKind.CLIENT)
243243
.hasParent(trace.getSpan(2))
244-
.hasAttributesSatisfyingExactly(attrs.toArray(new AttributeAssertion[0]));
244+
.hasAttributesSatisfyingExactly(attrs);
245245
},
246246
span -> {
247247
List<AttributeAssertion> attrs = new ArrayList<>();
@@ -256,7 +256,7 @@ void testDubboChain() throws ReflectiveOperationException {
256256
"io.opentelemetry.instrumentation.apachedubbo.v2_7.api.HelloService/hello")
257257
.hasKind(SpanKind.SERVER)
258258
.hasParent(trace.getSpan(3))
259-
.hasAttributesSatisfying(attrs.toArray(new AttributeAssertion[0]));
259+
.hasAttributesSatisfying(attrs);
260260
}));
261261

262262
testing()
@@ -278,8 +278,7 @@ void testDubboChain() throws ReflectiveOperationException {
278278
rpcMethodAssertions(
279279
"io.opentelemetry.instrumentation.apachedubbo.v2_7.api.HelloService",
280280
"hello"));
281-
point.hasAttributesSatisfyingExactly(
282-
attrs.toArray(new AttributeAssertion[0]));
281+
point.hasAttributesSatisfyingExactly(attrs);
283282
},
284283
point -> {
285284
List<AttributeAssertion> attrs = new ArrayList<>();
@@ -288,8 +287,7 @@ void testDubboChain() throws ReflectiveOperationException {
288287
rpcMethodAssertions(
289288
"io.opentelemetry.instrumentation.apachedubbo.v2_7.api.MiddleService",
290289
"hello"));
291-
point.hasAttributesSatisfyingExactly(
292-
attrs.toArray(new AttributeAssertion[0]));
290+
point.hasAttributesSatisfyingExactly(attrs);
293291
}))));
294292

295293
testing()
@@ -319,8 +317,7 @@ void testDubboChain() throws ReflectiveOperationException {
319317
satisfies(
320318
NETWORK_TYPE,
321319
AbstractDubboTest::assertNetworkType));
322-
point.hasAttributesSatisfyingExactly(
323-
attrs.toArray(new AttributeAssertion[0]));
320+
point.hasAttributesSatisfyingExactly(attrs);
324321
},
325322
point -> {
326323
List<AttributeAssertion> attrs = new ArrayList<>();
@@ -337,8 +334,7 @@ void testDubboChain() throws ReflectiveOperationException {
337334
satisfies(
338335
NETWORK_TYPE,
339336
AbstractDubboTest::assertNetworkType));
340-
point.hasAttributesSatisfyingExactly(
341-
attrs.toArray(new AttributeAssertion[0]));
337+
point.hasAttributesSatisfyingExactly(attrs);
342338
}))));
343339
}
344340

@@ -413,7 +409,7 @@ void testDubboChainInJvm() throws ReflectiveOperationException {
413409
span.hasName("org.apache.dubbo.rpc.service.GenericService/$invoke")
414410
.hasKind(SpanKind.CLIENT)
415411
.hasParent(trace.getSpan(0))
416-
.hasAttributesSatisfyingExactly(attrs.toArray(new AttributeAssertion[0]));
412+
.hasAttributesSatisfyingExactly(attrs);
417413
},
418414
span -> {
419415
List<AttributeAssertion> attrs = new ArrayList<>();
@@ -428,7 +424,7 @@ void testDubboChainInJvm() throws ReflectiveOperationException {
428424
"io.opentelemetry.instrumentation.apachedubbo.v2_7.api.MiddleService/hello")
429425
.hasKind(SpanKind.SERVER)
430426
.hasParent(trace.getSpan(1))
431-
.hasAttributesSatisfying(attrs.toArray(new AttributeAssertion[0]));
427+
.hasAttributesSatisfying(attrs);
432428
}));
433429

434430
testing()
@@ -450,8 +446,7 @@ void testDubboChainInJvm() throws ReflectiveOperationException {
450446
rpcMethodAssertions(
451447
"io.opentelemetry.instrumentation.apachedubbo.v2_7.api.MiddleService",
452448
"hello"));
453-
point.hasAttributesSatisfyingExactly(
454-
attrs.toArray(new AttributeAssertion[0]));
449+
point.hasAttributesSatisfyingExactly(attrs);
455450
}))));
456451

457452
testing()
@@ -481,8 +476,7 @@ void testDubboChainInJvm() throws ReflectiveOperationException {
481476
satisfies(
482477
NETWORK_TYPE,
483478
AbstractDubboTest::assertNetworkType));
484-
point.hasAttributesSatisfyingExactly(
485-
attrs.toArray(new AttributeAssertion[0]));
479+
point.hasAttributesSatisfyingExactly(attrs);
486480
}))));
487481
}
488482
}

instrumentation/aws-sdk/aws-sdk-2.2/testing/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AbstractAws2ClientTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ void testTimeoutAndRetryErrorsAreNotCaptured() {
933933
.hasStatus(StatusData.error())
934934
.hasException(thrown)
935935
.hasNoParent()
936-
.hasAttributesSatisfyingExactly(attrs.toArray(new AttributeAssertion[0]));
936+
.hasAttributesSatisfyingExactly(attrs);
937937
}));
938938
}
939939

instrumentation/grpc-1.6/library/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ tasks {
2929
testClassesDirs = sourceSets.test.get().output.classesDirs
3030
classpath = sourceSets.test.get().runtimeClasspath
3131

32+
systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean)
33+
jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true")
34+
// latest dep test occasionally fails because network type is ipv6 instead of the expected ipv4
35+
// and peer address is 0:0:0:0:0:0:0:1 instead of 127.0.0.1
36+
jvmArgs("-Djava.net.preferIPv4Stack=true")
37+
3238
jvmArgs("-Dotel.semconv-stability.opt-in=rpc")
3339
}
3440

instrumentation/grpc-1.6/testing/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/AbstractGrpcStreamingTest.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,7 @@ public void onCompleted() {
239239
span.hasName("example.Greeter/Conversation")
240240
.hasKind(SpanKind.CLIENT)
241241
.hasNoParent()
242-
.hasAttributesSatisfyingExactly(
243-
addExtraClientAttributes(attrs.toArray(new AttributeAssertion[0])))
242+
.hasAttributesSatisfyingExactly(addExtraClientAttributes(attrs))
244243
.satisfies(
245244
spanData ->
246245
assertThat(spanData.getEvents())
@@ -271,7 +270,7 @@ public void onCompleted() {
271270
span.hasName("example.Greeter/Conversation")
272271
.hasKind(SpanKind.SERVER)
273272
.hasParent(trace.getSpan(0))
274-
.hasAttributesSatisfyingExactly(attrs.toArray(new AttributeAssertion[0]))
273+
.hasAttributesSatisfyingExactly(attrs)
275274
.satisfies(
276275
spanData ->
277276
assertThat(spanData.getEvents())
@@ -298,8 +297,7 @@ public void onCompleted() {
298297
"example.Greeter", "Conversation"));
299298
attrs.add(
300299
grpcStatusCodeAssertion(Status.Code.OK.value()));
301-
point.hasAttributesSatisfying(
302-
attrs.toArray(new AttributeAssertion[0]));
300+
point.hasAttributesSatisfying(attrs);
303301
}))));
304302
testing()
305303
.waitAndAssertMetrics(
@@ -323,8 +321,7 @@ public void onCompleted() {
323321
"example.Greeter", "Conversation"));
324322
attrs.add(
325323
grpcStatusCodeAssertion(Status.Code.OK.value()));
326-
point.hasAttributesSatisfying(
327-
attrs.toArray(new AttributeAssertion[0]));
324+
point.hasAttributesSatisfying(attrs);
328325
}))));
329326
}
330327

0 commit comments

Comments
 (0)