Skip to content

Commit 46b5cfd

Browse files
committed
Update test.
1 parent 28d7bd2 commit 46b5cfd

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

postgres/tests/py_tests/test_stateless_catalog_resilience.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from pathlib import Path
1010
import os
11+
import shutil
1112

1213
import asyncpg
1314
import pytest
@@ -35,6 +36,13 @@ async def test_stateless_catalog_recovers_from_legacy_non_catalog_path(db_conn:
3536
poisoned_path.parent.mkdir(parents=True, exist_ok=True)
3637
poisoned_path.write_text("not a deeplake catalog table", encoding="utf-8")
3738

39+
# When running as root (CI), ensure postgres user can delete the file
40+
if os.geteuid() == 0:
41+
user = os.environ.get("USER", "postgres")
42+
for p in [root_path, root_path / "__deeplake_catalog"]:
43+
shutil.chown(p, user=user, group=user)
44+
shutil.chown(poisoned_path, user=user, group=user)
45+
3846
await db_conn.execute(f"SET deeplake.root_path = {_sql_literal(str(root_path))}")
3947

4048
# If recovery worked, catalog-backed table registration should still work.

0 commit comments

Comments
 (0)