Skip to content

Commit 9481bd4

Browse files
Haizhou ZhaoHaizhou Zhao
Haizhou Zhao
authored and
Haizhou Zhao
committed
Fix sqlite related test failures
1 parent b55ee3d commit 9481bd4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/TestBaseWithCatalog.java

+7
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,17 @@ public static void createWarehouseAndStartRest() throws IOException {
7979
// prevent using already-in-use port when testing
8080
System.setProperty("rest.port", String.valueOf(MetaStoreUtils.findFreePort()));
8181
System.setProperty(CatalogProperties.WAREHOUSE_LOCATION, warehouse.getAbsolutePath());
82+
// In-memory sqlite database by default is private to the connection that created it.
83+
// If more than 1 jdbc connection backed by in-memory sqlite is created behind one
84+
// JdbcCatalog, then different jdbc connections could provide different views of table
85+
// status even belonging to the same catalog. Reference:
86+
// https://www.sqlite.org/inmemorydb.html
87+
System.setProperty(CatalogProperties.CLIENT_POOL_SIZE, "1");
8288
restServer.start(false);
8389
restCatalog = RCKUtils.initCatalogClient();
8490
System.clearProperty("rest.port");
8591
System.clearProperty(CatalogProperties.WAREHOUSE_LOCATION);
92+
System.clearProperty(CatalogProperties.CLIENT_POOL_SIZE);
8693
} catch (Exception e) {
8794
throw new RuntimeException(e);
8895
}

0 commit comments

Comments
 (0)