Skip to content

Commit

Permalink
dummy PR to trigger integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
GaoleMeng committed Nov 28, 2023
1 parent cda407d commit 1d5922f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,12 @@ ConnectionWorkerPool getTestOnlyConnectionWorkerPool() {
return connectionWorkerPool;
}

// A method to clear the static connectio pool to avoid making pool visible to other tests.
@VisibleForTesting
static void clearConnectionPool() {
connectionPoolMap.clear();
}

/** A builder of {@link StreamWriter}s. */
public static final class Builder {
private static final long DEFAULT_MAX_INFLIGHT_REQUESTS = 1000L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class ConnectionWorkerPoolTest {
private static MockServiceHelper serviceHelper;
private BigQueryWriteSettings clientSettings;

private static final String TEST_TRACE_ID = "home:job1";
private static final String TEST_TRACE_ID = "DATAFLOW:job_id";
private static final String TEST_STREAM_1 = "projects/p1/datasets/d1/tables/t1/streams/_default";
private static final String TEST_STREAM_2 = "projects/p1/datasets/d1/tables/t2/streams/_default";

Expand Down Expand Up @@ -417,6 +417,10 @@ public void testCloseExternalClient()
assertThat(response.getAppendResult().getOffset().getValue()).isEqualTo(i);
}
assertThat(testBigQueryWrite.getAppendRequests().size()).isEqualTo(appendCount * 2);
for (int i = 0; i < streamWriterList.size(); i++) {
streamWriterList.get(i).close();
}
StreamWriter.clearConnectionPool();
}

private AppendRowsResponse createAppendResponse(long offset) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import com.google.cloud.bigquery.storage.v1.Exceptions.OffsetOutOfRange;
import com.google.cloud.bigquery.storage.v1.Exceptions.SchemaMismatchedException;
import com.google.cloud.bigquery.storage.v1.Exceptions.StreamFinalizedException;
import com.google.cloud.bigquery.storage.v1beta1.Storage.Stream;
import com.google.cloud.bigquery.testing.RemoteBigQueryHelper;
import com.google.common.collect.ImmutableList;
import com.google.protobuf.ByteString;
Expand Down

0 comments on commit 1d5922f

Please sign in to comment.