Skip to content

Commit cc7db7f

Browse files
committed
tests: remove too-fragile test, fix fetch_arrow_table
1 parent db9ef60 commit cc7db7f

File tree

2 files changed

+1
-40
lines changed

2 files changed

+1
-40
lines changed

tests/fast/threading/test_fetching.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def test_fetching():
4040

4141
result4 = conn.execute(
4242
f"SELECT COUNT(*) FROM batch_data WHERE name LIKE 'name_{thread_id}_%'"
43-
).fetcharrow_table()
43+
).fetch_arrow_table()
4444
assert result4.num_rows == 1
4545
finally:
4646
conn.close()

tests/fast/threading/test_module_lifecycle.py

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -84,45 +84,6 @@ def test_dynamic_module_loading():
8484
assert result == 42
8585

8686

87-
@pytest.mark.parallel_threads(1)
88-
def test_complete_module_unload_with_live_connections():
89-
"""Test the dangerous scenario: complete module unload with live connections."""
90-
91-
import duckdb
92-
93-
conn1 = duckdb.connect(":memory:")
94-
conn1.execute("CREATE TABLE danger_test (id INTEGER)")
95-
conn1.execute("INSERT INTO danger_test VALUES (123)")
96-
97-
module_id_1 = id(sys.modules["duckdb"])
98-
99-
if "duckdb" in sys.modules:
100-
del sys.modules["duckdb"]
101-
del duckdb
102-
103-
# TODO: Rethink this behavior - the module is unloaded, but we
104-
# didn't invalidate all the connections and state... so even after
105-
# unload, conn1 works.
106-
107-
result = conn1.execute("SELECT * FROM danger_test").fetchone()[0]
108-
assert result == 123
109-
110-
# Reimport creates new module state, but static cache should be reset
111-
import duckdb
112-
113-
module_id_2 = id(sys.modules["duckdb"])
114-
assert module_id_1 != module_id_2, "Should have different module instances"
115-
116-
conn2 = duckdb.connect(":memory:")
117-
conn2.execute("CREATE TABLE safe_test (id INTEGER)")
118-
conn2.execute("INSERT INTO safe_test VALUES (456)")
119-
result2 = conn2.execute("SELECT * FROM safe_test").fetchone()[0]
120-
assert result2 == 456
121-
122-
conn2.close()
123-
conn1.close()
124-
125-
12687
def test_import_cache_consistency():
12788
"""Test that import cache remains consistent across module operations."""
12889

0 commit comments

Comments
 (0)