Skip to content

Commit

Permalink
test: fix flaky IT testExecuteSelectWithCredentials
Browse files Browse the repository at this point in the history
Use priority instead of job timeout to force non-fast query in executeSelect.
  • Loading branch information
PhongChuong committed Sep 26, 2024
1 parent 8f2e5c5 commit eeacdd2
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
import com.google.cloud.bigquery.PolicyTags;
import com.google.cloud.bigquery.PrimaryKey;
import com.google.cloud.bigquery.QueryJobConfiguration;
import com.google.cloud.bigquery.QueryJobConfiguration.Priority;
import com.google.cloud.bigquery.QueryParameterValue;
import com.google.cloud.bigquery.Range;
import com.google.cloud.bigquery.RangePartitioning;
Expand Down Expand Up @@ -191,7 +192,6 @@
import java.util.logging.Logger;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.Timeout;
Expand Down Expand Up @@ -3251,7 +3251,6 @@ public void testExecuteSelectDefaultConnectionSettings() throws SQLException {
}

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

ConnectionSettings connectionSettings =
ConnectionSettings.newBuilder()
.setJobTimeoutMs(10L) // Force non-fast query to use BigQueryReadClient.
.setPriority(Priority.INTERACTIVE) // Force non-fast query to use BigQueryReadClient.
.setDefaultDataset(DatasetId.of(DATASET))
.build();
Connection connectionGoodCredentials =
Expand Down

0 comments on commit eeacdd2

Please sign in to comment.