Skip to content

Commit dd81d25

Browse files
committed
add test to confirm resend attribute does not get set on success flow
1 parent 5b5dbaf commit dd81d25

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

java-bigquery/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpcTest.java

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ private void verifySpan(
160160
assertEquals(
161161
gcpResourceDestinationId,
162162
rpcSpan.getAttributes().get(BigQueryTelemetryTracer.GCP_RESOURCE_DESTINATION_ID));
163+
164+
// this attribute should never get set in a normal success flow
165+
assertNull(rpcSpan.getAttributes().get(BigQueryTelemetryTracer.HTTP_REQUEST_RESEND_COUNT));
163166
}
164167

165168
private void verifySpanProductionAttributes(
@@ -1168,12 +1171,7 @@ public void testResendCountOnRetry() throws Exception {
11681171
.orElse(null);
11691172
assertNotNull(rpcSpan);
11701173
assertEquals(
1171-
2L,
1172-
rpcSpan
1173-
.getAttributes()
1174-
.get(
1175-
BigQueryTelemetryTracer
1176-
.HTTP_REQUEST_RESEND_COUNT));
1174+
2L, rpcSpan.getAttributes().get(BigQueryTelemetryTracer.HTTP_REQUEST_RESEND_COUNT));
11771175
} finally {
11781176
com.google.cloud.bigquery.BigQueryRetryAlgorithm.setCurrentAttempt(0);
11791177
}
@@ -1308,12 +1306,7 @@ public void testResendCountNotSetWhenDisabled() throws Exception {
13081306
.findFirst()
13091307
.orElse(null);
13101308
assertNotNull(rpcSpan);
1311-
assertNull(
1312-
rpcSpan
1313-
.getAttributes()
1314-
.get(
1315-
BigQueryTelemetryTracer
1316-
.HTTP_REQUEST_RESEND_COUNT));
1309+
assertNull(rpcSpan.getAttributes().get(BigQueryTelemetryTracer.HTTP_REQUEST_RESEND_COUNT));
13171310
} finally {
13181311
com.google.cloud.bigquery.BigQueryRetryAlgorithm.setCurrentAttempt(0);
13191312
}

0 commit comments

Comments
 (0)