File tree Expand file tree Collapse file tree
gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -476,7 +476,7 @@ public void testInsertAll() {
476476 }
477477
478478 @ Test
479- public void testInsertAllWithSuffix () {
479+ public void testInsertAllWithSuffix () throws InterruptedException {
480480 String tableName = "test_insert_all_with_suffix_table" ;
481481 BaseTableInfo tableInfo = TableInfo .of (TableId .of (DATASET , tableName ), TABLE_SCHEMA );
482482 assertNotNull (bigquery .create (tableInfo ));
@@ -505,7 +505,12 @@ public void testInsertAllWithSuffix() {
505505 assertFalse (response .hasErrors ());
506506 assertEquals (0 , response .insertErrors ().size ());
507507 String newTableName = tableName + "_suffix" ;
508- assertNotNull (bigquery .getTable (DATASET , newTableName , TableOption .fields ()));
508+ BaseTableInfo suffixTable = bigquery .getTable (DATASET , newTableName , TableOption .fields ());
509+ while (suffixTable == null ) {
510+ Thread .sleep (1000L );
511+ suffixTable = bigquery .getTable (DATASET , newTableName , TableOption .fields ());
512+ }
513+ assertNotNull (suffixTable );
509514 assertTrue (bigquery .delete (TableId .of (DATASET , tableName )));
510515 assertTrue (bigquery .delete (TableId .of (DATASET , newTableName )));
511516 }
You can’t perform that action at this time.
0 commit comments