Skip to content

Commit c85ae13

Browse files
traskotelbot[bot]
andauthored
Fix tests to work with lettuce 7.0 (#15120)
Co-authored-by: otelbot <[email protected]>
1 parent 129531c commit c85ae13

File tree

2 files changed

+40
-4
lines changed

2 files changed

+40
-4
lines changed

instrumentation/lettuce/lettuce-5.1/testing/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceSyncClientAuthTest.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,24 @@ void testAuthCommand() throws Exception {
102102
maybeStable(DB_STATEMENT),
103103
stringAssert ->
104104
stringAssert.startsWith("CLIENT SETINFO lib-ver"))))),
105+
trace ->
106+
trace.hasSpansSatisfyingExactly(
107+
span ->
108+
span.hasName("CLIENT")
109+
.hasKind(SpanKind.CLIENT)
110+
.hasAttributesSatisfyingExactly(
111+
addExtraAttributes(
112+
equalTo(NETWORK_TYPE, "ipv4"),
113+
equalTo(NETWORK_PEER_ADDRESS, ip),
114+
equalTo(NETWORK_PEER_PORT, port),
115+
equalTo(SERVER_ADDRESS, host),
116+
equalTo(SERVER_PORT, port),
117+
equalTo(maybeStable(DB_SYSTEM), "redis"),
118+
satisfies(
119+
maybeStable(DB_STATEMENT),
120+
stringAssert ->
121+
stringAssert.startsWith(
122+
"CLIENT MAINT_NOTIFICATIONS"))))),
105123
trace ->
106124
trace.hasSpansSatisfyingExactly(
107125
span ->

instrumentation/lettuce/lettuce-5.1/testing/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/AbstractLettuceSyncClientTest.java

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ void testListCommand() {
238238
RedisCommands<String, String> commands = containerConnection.connection.sync();
239239

240240
if (Boolean.getBoolean("testLatestDeps")) {
241-
// ignore CLIENT SETINFO traces
242-
testing().waitForTraces(2);
241+
// ignore CLIENT SETINFO and MAINT_NOTIFICATIONS traces
242+
testing().waitForTraces(3);
243243
testing().clearData();
244244
}
245245

@@ -417,6 +417,24 @@ void testDebugSegfaultCommandWithNoArgumentProducesNoSpan() {
417417
maybeStable(DB_STATEMENT),
418418
stringAssert ->
419419
stringAssert.startsWith("CLIENT SETINFO lib-ver"))))),
420+
trace ->
421+
trace.hasSpansSatisfyingExactly(
422+
span ->
423+
span.hasName("CLIENT")
424+
.hasKind(SpanKind.CLIENT)
425+
.hasAttributesSatisfyingExactly(
426+
addExtraAttributes(
427+
equalTo(NETWORK_TYPE, "ipv4"),
428+
equalTo(NETWORK_PEER_ADDRESS, ip),
429+
equalTo(NETWORK_PEER_PORT, containerConnection.port),
430+
equalTo(SERVER_ADDRESS, host),
431+
equalTo(SERVER_PORT, containerConnection.port),
432+
equalTo(maybeStable(DB_SYSTEM), "redis"),
433+
satisfies(
434+
maybeStable(DB_STATEMENT),
435+
stringAssert ->
436+
stringAssert.startsWith(
437+
"CLIENT MAINT_NOTIFICATIONS"))))),
420438
trace ->
421439
trace.hasSpansSatisfyingExactly(
422440
span ->
@@ -459,8 +477,8 @@ void testShutdownCommandProducesNoSpan() {
459477
RedisCommands<String, String> commands = containerConnection.connection.sync();
460478

461479
if (Boolean.getBoolean("testLatestDeps")) {
462-
// ignore CLIENT SETINFO traces
463-
testing().waitForTraces(2);
480+
// ignore CLIENT SETINFO and MAINT_NOTIFICATIONS traces
481+
testing().waitForTraces(3);
464482
testing().clearData();
465483
}
466484

0 commit comments

Comments
 (0)