Skip to content

Commit ba39db4

Browse files
committed
test: use GCC unwinder before loading Endstone on Linux
1 parent 0800990 commit ba39db4

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

‎tests/conftest.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import ctypes
2+
import sys
3+
4+
if sys.platform == "linux":
5+
# Tests share a process; production keeps Amulet in the separate Worker.
6+
# Load GCC's unwinder before Endstone's bundled LLVM libunwind.
7+
ctypes.CDLL("libgcc_s.so.1", mode=ctypes.RTLD_GLOBAL)

‎tests/test_amulet_reader.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,10 @@ def test_iter_visible_state_exhausts_in_repository_worker_thread(tmp_path: Path)
4040
result = executor.submit(_read_all, db_path).result(timeout=10)
4141

4242
assert result == expected
43+
44+
45+
def test_missing_leveldb_raises_python_exception(tmp_path: Path) -> None:
46+
from amulet.leveldb import LevelDB, LevelDBException
47+
48+
with pytest.raises(LevelDBException, match="No database exists"):
49+
LevelDB(str(tmp_path / "missing"), False)

0 commit comments

Comments
 (0)