Skip to content

Commit aadb8fb

Browse files
author
Michel Davit
committed
Remove useless wait
1 parent 263ee77 commit aadb8fb

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

integration/src/test/scala/com/spotify/scio/bigquery/TypedBigQueryIT.scala

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -126,23 +126,12 @@ class TypedBigQueryIT extends PipelineSpec with BeforeAndAfterAll {
126126
Try(bq.tables.delete(avroTable.ref))
127127
}
128128

129-
def waitForTable(table: Table.Spec): Unit = {
130-
var retries = 0
131-
while (!bq.tables.exists(table.ref) && retries < 3) {
132-
Thread.sleep(500)
133-
retries += 1
134-
}
135-
if (retries >= 3) throw new RuntimeException(s"Table $table not found")
136-
}
137-
138129
"TypedBigQuery" should "handle records as TableRow" in {
139130
runWithRealContext(options) { sc =>
140131
sc.parallelize(records)
141132
.saveAsTypedBigQueryTable(typedTable, createDisposition = CREATE_IF_NEEDED)
142133
}.waitUntilFinish()
143134

144-
waitForTable(typedTable)
145-
146135
runWithRealContext(options) { sc =>
147136
val data = sc.typedBigQuery[Record](typedTable)
148137
data should containInAnyOrder(records)
@@ -160,8 +149,6 @@ class TypedBigQueryIT extends PipelineSpec with BeforeAndAfterAll {
160149
)
161150
}.waitUntilFinish()
162151

163-
waitForTable(tableRowTable)
164-
165152
runWithRealContext(options) { sc =>
166153
val data = sc.bigQueryTable(tableRowTable).map(Record.fromTableRow)
167154
data should containInAnyOrder(records)
@@ -181,8 +168,6 @@ class TypedBigQueryIT extends PipelineSpec with BeforeAndAfterAll {
181168
)
182169
}.waitUntilFinish()
183170

184-
waitForTable(avroTable)
185-
186171
runWithRealContext(options) { sc =>
187172
val data =
188173
sc.bigQueryTable(avroTable, Format.GenericRecordWithLogicalTypes).map(Record.fromAvro)

0 commit comments

Comments
 (0)