Skip to content

Commit d463c15

Browse files
authored
fix: StreamWriterTest to allow version in trace ID (#12084)
When the source tree of an integration build has non-SNAPSHOT version, the unit test "testAppendWithMissingValueMap" was failing because the trace ID contained the version of the artifact. b/492517601 The conventional commit prefix is “fix:” so that I confirm the effect in next Release Please pull request after merging this pull request.
1 parent f1c04a9 commit d463c15

File tree

1 file changed

+4
-1
lines changed
  • java-bigquerystorage/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1

1 file changed

+4
-1
lines changed

java-bigquerystorage/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/StreamWriterTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,10 @@ private void verifyAppendRequests(long appendCount) {
403403
// First request received by server should have schema and stream name.
404404
assertTrue(serverRequest.getProtoRows().hasWriterSchema());
405405
assertEquals(TEST_STREAM_1, serverRequest.getWriteStream());
406-
assertEquals("java-streamwriter " + TEST_TRACE_ID, serverRequest.getTraceId());
406+
// The trace ID would look like "java-streamwriter:3.23.0 DATAFLOW:job_id" if
407+
// StreamWriter.getFullTraceId contains the version (non SNAPSHOT version);
408+
// otherwise it's "java-streamwriter DATAFLOW:job_id".
409+
assertThat(serverRequest.getTraceId()).matches("java-streamwriter(:.+)? " + TEST_TRACE_ID);
407410
} else {
408411
// Following request should not have schema and stream name.
409412
assertFalse(serverRequest.getProtoRows().hasWriterSchema());

0 commit comments

Comments
 (0)