Skip to content

Commit 4930093

Browse files
authored
test: fix flaky IT testExecuteSelectWithCredentials (#3497)
Use priority instead of job timeout to force non-fast query in executeSelect.
1 parent 8f2e5c5 commit 4930093

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
import com.google.cloud.bigquery.PolicyTags;
110110
import com.google.cloud.bigquery.PrimaryKey;
111111
import com.google.cloud.bigquery.QueryJobConfiguration;
112+
import com.google.cloud.bigquery.QueryJobConfiguration.Priority;
112113
import com.google.cloud.bigquery.QueryParameterValue;
113114
import com.google.cloud.bigquery.Range;
114115
import com.google.cloud.bigquery.RangePartitioning;
@@ -191,7 +192,6 @@
191192
import java.util.logging.Logger;
192193
import org.junit.AfterClass;
193194
import org.junit.BeforeClass;
194-
import org.junit.Ignore;
195195
import org.junit.Rule;
196196
import org.junit.Test;
197197
import org.junit.rules.Timeout;
@@ -3251,7 +3251,6 @@ public void testExecuteSelectDefaultConnectionSettings() throws SQLException {
32513251
}
32523252

32533253
@Test
3254-
@Ignore("https://github.com/googleapis/java-bigquery/issues/3471")
32553254
public void testExecuteSelectWithCredentials() throws SQLException {
32563255
// This test validate that executeSelect uses the same credential provided by the BigQuery
32573256
// object used to create the Connection client.
@@ -3272,7 +3271,7 @@ public void testExecuteSelectWithCredentials() throws SQLException {
32723271

32733272
ConnectionSettings connectionSettings =
32743273
ConnectionSettings.newBuilder()
3275-
.setJobTimeoutMs(10L) // Force non-fast query to use BigQueryReadClient.
3274+
.setPriority(Priority.INTERACTIVE) // Force non-fast query to use BigQueryReadClient.
32763275
.setDefaultDataset(DatasetId.of(DATASET))
32773276
.build();
32783277
Connection connectionGoodCredentials =

0 commit comments

Comments
 (0)