diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index e908a9801..806a59292 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -5992,10 +5992,10 @@ void testCopyJobStatistics() throws InterruptedException, TimeoutException { @Test void testSnapshotTableCopyJob() throws InterruptedException { - String sourceTableName = "test_copy_job_base_table"; + String sourceTableName = generateTableName("test_copy_job_base_table"); String ddlTableName = TABLE_ID_SIMPLE.getTable(); // this creates a snapshot table at specified snapshotTime - String snapshotTableName = "test_snapshot_table"; + String snapshotTableName = generateTableName("test_snapshot_table"); // Create source table with some data in it String ddlQuery = String.format( @@ -6039,7 +6039,7 @@ void testSnapshotTableCopyJob() throws InterruptedException { ((SnapshotTableDefinition) snapshotTable.getDefinition()).getBaseTableId().getTable()); // Restore base table to a new table - String restoredTableName = "test_restore_table"; + String restoredTableName = generateTableName("test_restore_table"); TableId restoredTableId = TableId.of(DATASET, restoredTableName); CopyJobConfiguration restoreConfiguration = CopyJobConfiguration.newBuilder(restoredTableId, snapshotTableId) @@ -6455,7 +6455,7 @@ void testCancelNonExistingJob() { @Test void testInsertFromFile() throws InterruptedException, IOException, TimeoutException { - String destinationTableName = "test_insert_from_file_table"; + String destinationTableName = generateTableName("test_insert_from_file_table"); TableId tableId = TableId.of(DATASET, destinationTableName); WriteChannelConfiguration configuration = WriteChannelConfiguration.newBuilder(tableId) @@ -6528,7 +6528,7 @@ void testInsertFromFile() throws InterruptedException, IOException, TimeoutExcep @Test void testInsertFromFileWithLabels() throws InterruptedException, IOException, TimeoutException { - String destinationTableName = "test_insert_from_file_table_with_labels"; + String destinationTableName = generateTableName("test_insert_from_file_table_with_labels"); TableId tableId = TableId.of(DATASET, destinationTableName); WriteChannelConfiguration configuration = WriteChannelConfiguration.newBuilder(tableId) @@ -6559,7 +6559,8 @@ void testInsertFromFileWithLabels() throws InterruptedException, IOException, Ti @Test void testInsertWithDecimalTargetTypes() throws InterruptedException, IOException, TimeoutException { - String destinationTableName = "test_insert_from_file_table_with_decimal_target_type"; + String destinationTableName = + generateTableName("test_insert_from_file_table_with_decimal_target_type"); TableId tableId = TableId.of(DATASET, destinationTableName); WriteChannelConfiguration configuration = WriteChannelConfiguration.newBuilder(tableId) @@ -6692,7 +6693,8 @@ void testLocation() throws Exception { @Test void testWriteChannelPreserveAsciiControlCharacters() throws InterruptedException, IOException, TimeoutException { - String destinationTableName = "test_write_channel_preserve_ascii_control_characters"; + String destinationTableName = + generateTableName("test_write_channel_preserve_ascii_control_characters"); TableId tableId = TableId.of(DATASET, destinationTableName); WriteChannelConfiguration configuration = WriteChannelConfiguration.newBuilder(tableId) @@ -6740,7 +6742,7 @@ void testLoadJobPreserveAsciiControlCharacters() throws InterruptedException { @Test void testReferenceFileSchemaUriForAvro() { try { - String destinationTableName = "test_reference_file_schema_avro"; + String destinationTableName = generateTableName("test_reference_file_schema_avro"); TableId tableId = TableId.of(DATASET, destinationTableName); Schema expectedSchema = Schema.of( @@ -6799,7 +6801,7 @@ void testReferenceFileSchemaUriForAvro() { @Test void testReferenceFileSchemaUriForParquet() { try { - String destinationTableName = "test_reference_file_schema_parquet"; + String destinationTableName = generateTableName("test_reference_file_schema_parquet"); TableId tableId = TableId.of(DATASET, destinationTableName); Schema expectedSchema = Schema.of( @@ -6856,7 +6858,8 @@ void testReferenceFileSchemaUriForParquet() { @Test void testCreateExternalTableWithReferenceFileSchemaAvro() { - String destinationTableName = "test_create_external_table_reference_file_schema_avro"; + String destinationTableName = + generateTableName("test_create_external_table_reference_file_schema_avro"); TableId tableId = TableId.of(DATASET, destinationTableName); Schema expectedSchema = Schema.of( @@ -6895,7 +6898,8 @@ void testCreateExternalTableWithReferenceFileSchemaAvro() { @Test void testCreateExternalTableWithReferenceFileSchemaParquet() { - String destinationTableName = "test_create_external_table_reference_file_schema_parquet"; + String destinationTableName = + generateTableName("test_create_external_table_reference_file_schema_parquet"); TableId tableId = TableId.of(DATASET, destinationTableName); Schema expectedSchema = Schema.of( @@ -6936,9 +6940,9 @@ void testCreateExternalTableWithReferenceFileSchemaParquet() { @Test void testCloneTableCopyJob() throws InterruptedException { - String sourceTableName = "test_copy_job_base_table"; + String sourceTableName = generateTableName("test_copy_job_base_table"); String ddlTableName = TABLE_ID_SIMPLE.getTable(); - String cloneTableName = "test_clone_table"; + String cloneTableName = generateTableName("test_clone_table"); // Create source table with some data in it String ddlQuery = String.format( @@ -7514,7 +7518,7 @@ void testUniverseDomainWithMatchingDomain() { @Test void testExternalTableMetadataCachingNotEnable() throws InterruptedException { - String tableName = "test_metadata_cache_not_enable"; + String tableName = generateTableName("test_metadata_cache_not_enable"); TableId tableId = TableId.of(DATASET, tableName); ExternalTableDefinition externalTableDefinition = ExternalTableDefinition.of( @@ -7557,7 +7561,7 @@ void testExternalTableMetadataCachingNotEnable() throws InterruptedException { void testExternalMetadataCacheModeFailForNonBiglake() { // Validate that MetadataCacheMode is passed to the backend. // TODO: Enhance this test after BigLake testing infrastructure is inplace. - String tableName = "test_metadata_cache_mode_fail_for_non_biglake"; + String tableName = generateTableName("test_metadata_cache_mode_fail_for_non_biglake"); TableId tableId = TableId.of(DATASET, tableName); ExternalTableDefinition externalTableDefinition = ExternalTableDefinition.newBuilder( @@ -7582,7 +7586,7 @@ void testExternalMetadataCacheModeFailForNonBiglake() { @Test void testObjectTable() throws InterruptedException { - String tableName = "test_object_table"; + String tableName = generateTableName("test_object_table"); TableId tableId = TableId.of(DATASET, tableName); String sourceUri = "gs://" + BUCKET + "/" + JSON_LOAD_FILE; @@ -7653,7 +7657,7 @@ void testLoadConfigurationFlexibleColumnName() throws InterruptedException { // mapping. // Test v1 mapping. - String v1TableName = "flexible_column_name_data_testing_table_v1"; + String v1TableName = generateTableName("flexible_column_name_data_testing_table_v1"); TableId v1TableId = TableId.of(DATASET, v1TableName); try { LoadJobConfiguration loadJobConfigurationV1 = @@ -7678,7 +7682,7 @@ void testLoadConfigurationFlexibleColumnName() throws InterruptedException { } // Test v2 mapping. - String v2TableName = "flexible_column_name_data_testing_table_v2"; + String v2TableName = generateTableName("flexible_column_name_data_testing_table_v2"); TableId v2TableId = TableId.of(DATASET, v2TableName); try { LoadJobConfiguration loadJobConfigurationV2 =