Skip to content

Commit a6461b5

Browse files
committed
Daemon again, plus pytest forked
1 parent 2898af0 commit a6461b5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,5 @@ dev = [
5757
"pytest-xdist==3.6.1",
5858
"pytest-rerunfailures==10.2",
5959
"bittensor-wallet>=4.0.0"
60+
"pytest-forked"
6061
]

tests/integration_tests/test_async_substrate_interface.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def get_free_port():
222222
print(f"Testing using server on port {port}")
223223
proxy = ProxyServer("wss://archive.sub.latent.to", 10, 20, port=port)
224224

225-
server_thread = threading.Thread(target=proxy.connect_and_serve)
225+
server_thread = threading.Thread(target=proxy.connect_and_serve, daemon=True)
226226
server_thread.start()
227227
await asyncio.sleep(3) # give the server start up time
228228
async with AsyncSubstrateInterface(
@@ -256,7 +256,7 @@ def get_free_port():
256256
assert "Pausing" in f.read()
257257
with open(asi_logger_path, "r") as f:
258258
assert "Timeout/ConnectionClosed occurred." in f.read()
259-
shutdown_thread = threading.Thread(target=proxy.close)
259+
shutdown_thread = threading.Thread(target=proxy.close, daemon=True)
260260
shutdown_thread.start()
261261
shutdown_thread.join(timeout=5)
262262
server_thread.join(timeout=5)

0 commit comments

Comments
 (0)