Skip to content

Commit

Permalink
Fewer inserts on BigQuery to avoid rate limit error during testing
Browse files Browse the repository at this point in the history
  • Loading branch information
schuemie committed Jan 14, 2025
1 parent 1abc92a commit f157b86
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tests/testthat/test-sendUpdates.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ for (testServer in testServers) {
on.exit(disconnect(connection), add = TRUE)
renderTranslateExecuteSql(connection, createSql)
expect_equal(renderTranslateExecuteSql(connection, sql), c(1, 1, 0))
renderTranslateExecuteSql(connection, createSql)
expect_equal(renderTranslateExecuteSql(connection, sql, runAsBatch = TRUE), c(1, 1, 0))
renderTranslateExecuteSql(connection, createSql)
rowsAffected <- dbSendStatement(connection, sql)
expect_equal(dbGetRowsAffected(rowsAffected), 2)
dbClearResult(rowsAffected)
if (testServer$connectionDetails$dbms != "bigquery") {
# Avoid rate limit error on BigQuery
renderTranslateExecuteSql(connection, createSql)
expect_equal(renderTranslateExecuteSql(connection, sql, runAsBatch = TRUE), c(1, 1, 0))
renderTranslateExecuteSql(connection, createSql)
rowsAffected <- dbSendStatement(connection, sql)
expect_equal(dbGetRowsAffected(rowsAffected), 2)
dbClearResult(rowsAffected)
}
})
}

0 comments on commit f157b86

Please sign in to comment.