Open electrum opened 2 years ago
I think the cause is different. The tests in TestBigQueryIntegrationSmokeTest don't use case-insensitive-name-mapping while the schema created in TestBigQueryCaseInsensitiveMapping with a non-lowercase name so the QueryRunner
in TestBigQueryIntegrationSmokeTest
cannot "find" the schema since it sends the request to BigQuery using the lowercased name when the actual name is Test_Drop_Case_Sensitive
.
The solution is to ensure isolation of TestBigQueryIntegrationSmokeTest
and TestBigQueryCaseInsensitiveMapping
which we do using the surefire setup in trino-bigquery.
Same problem manifests in base-jdbc based connectors if you start re-using the containers since the non-lowercase schema names will then cause query failures for any query runner not configured with case-insensitive-name-mapping. But we don't have that problem since most connector tests are containerised and each test spins up it's own container.
In the this test failure, the method
com.google.cloud.bigquery.BigQueryImpl.listTables()
is failing due to the schematest_drop_case_sensitive
getting dropped concurrently while the test is running. It is called in a loop over the schema names viaBigQueryMetadata.listTables()
.When we get a "not found" exception from
listTables()
, we can fetch the list of schema names again. If the schema still exists, something weird happened, so throw the error. Otherwise, there are two options: