Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assert;
Expand Down Expand Up @@ -98,6 +99,7 @@ public void onRetryAttempt(Status prevStatus, Metadata prevMetadata) {
@After
public void tearDown() throws Exception {
client.close();
client.awaitTermination(10, TimeUnit.SECONDS);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
import org.apache.arrow.memory.RootAllocator;
import org.apache.arrow.vector.VarCharVector;
Expand All @@ -60,6 +61,7 @@
import org.apache.arrow.vector.types.pojo.Field;
import org.apache.arrow.vector.types.pojo.FieldType;
import org.apache.arrow.vector.types.pojo.Schema;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down Expand Up @@ -103,6 +105,14 @@ public void setUp() throws Exception {
.build());
}

@After
public void cleanUp() throws InterruptedException {
serviceHelper.stop();

client.close();
client.awaitTermination(10, TimeUnit.SECONDS);
}

@Test
public void testMultiplexedAppendSuccess_NonNullTraceId() throws Exception {
testMultiplexedIngestion(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import org.json.JSONArray;
import org.json.JSONObject;
import org.junit.After;
Expand Down Expand Up @@ -158,6 +159,9 @@ public void setUp() throws Exception {
@After
public void tearDown() throws Exception {
serviceHelper.stop();

client.close();
client.awaitTermination(10, TimeUnit.SECONDS);
}

private JsonStreamWriter.Builder getTestJsonStreamWriterBuilder(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,11 @@ public void setUp() throws Exception {
@After
public void tearDown() throws Exception {
log.info("tearDown called");
client.close();
serviceHelper.stop();
StreamWriter.cleanUp();

client.close();
client.awaitTermination(10, TimeUnit.SECONDS);
}

private StreamWriter getMultiplexingTestStreamWriter() throws IOException {
Expand Down Expand Up @@ -1996,6 +1998,9 @@ public void testBuilderExplicitSetting() throws Exception {
((GoogleCredentialsProvider) writerSettings2.getCredentialsProvider())
.getScopesToApply()
.size());

client.close();
client.awaitTermination(10, TimeUnit.SECONDS);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import java.math.BigDecimal;
import java.util.Iterator;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
import org.json.JSONArray;
import org.json.JSONObject;
Expand Down Expand Up @@ -91,9 +92,10 @@ public static void beforeClass() throws IOException {
}

@AfterClass
public static void afterClass() {
public static void afterClass() throws InterruptedException {
if (client != null) {
client.close();
client.awaitTermination(10, TimeUnit.SECONDS);
}
if (bigquery != null) {
RemoteBigQueryHelper.forceDelete(bigquery, DATASET);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
import org.junit.AfterClass;
import org.junit.Assume;
Expand Down Expand Up @@ -74,9 +75,10 @@ public static void beforeClass() throws IOException {
}

@AfterClass
public static void afterClass() {
public static void afterClass() throws InterruptedException {
if (client != null) {
client.close();
client.awaitTermination(10, TimeUnit.SECONDS);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
import org.apache.avro.Conversions;
import org.apache.avro.LogicalTypes;
Expand Down Expand Up @@ -516,9 +517,10 @@ public static void beforeClass() throws IOException {
}

@AfterClass
public static void afterClass() {
public static void afterClass() throws InterruptedException {
if (client != null) {
client.close();
client.awaitTermination(10, TimeUnit.SECONDS);
}

if (bigquery != null) {
Expand Down Expand Up @@ -1436,7 +1438,8 @@ public void testStructAndArraySqlTypes() throws InterruptedException, IOExceptio
}

@Test
public void testSimpleReadWithBackgroundExecutorProvider() throws IOException {
public void testSimpleReadWithBackgroundExecutorProvider()
throws IOException, InterruptedException {
BigQueryReadSettings bigQueryReadSettings =
BigQueryReadSettings.newBuilder()
.setBackgroundExecutorProvider(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import java.time.LocalTime;
import java.util.Iterator;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import org.json.JSONArray;
import org.json.JSONObject;
import org.junit.AfterClass;
Expand Down Expand Up @@ -98,9 +99,10 @@ public static void beforeClass() throws IOException {
}

@AfterClass
public static void afterClass() {
public static void afterClass() throws InterruptedException {
if (client != null) {
client.close();
client.awaitTermination(10, TimeUnit.SECONDS);
}
if (bigquery != null) {
RemoteBigQueryHelper.forceDelete(bigquery, DATASET);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,10 @@ public static void beforeClass() throws IOException {
}

@AfterClass
public static void afterClass() {
public static void afterClass() throws InterruptedException {
if (client != null) {
client.close();
client.awaitTermination(10, TimeUnit.SECONDS);
}

if (bigquery != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.google.cloud.bigquery.storage.v1.ReadRowsRequest;
import com.google.cloud.bigquery.storage.v1.ReadSession;
import com.google.cloud.bigquery.storage.v1.SplitReadStreamRequest;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;
import org.junit.After;
import org.junit.AfterClass;
Expand Down Expand Up @@ -88,6 +89,7 @@ public void setUp() throws Exception {
@After
public void tearDown() throws Exception {
client.close();
client.awaitTermination(10, TimeUnit.SECONDS);
}

@AfterClass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Queue;
import java.util.concurrent.TimeUnit;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
Expand Down Expand Up @@ -67,6 +68,7 @@ public void setUp() throws IOException {
@After
public void tearDown() throws Exception {
client.close();
client.awaitTermination(10, TimeUnit.SECONDS);
}

@Test
Expand Down
Loading