We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c01f874 commit 1cfe029Copy full SHA for 1cfe029
tests/e2e_tests/conftest.py
@@ -1,3 +1,4 @@
1
+import asyncio
2
import logging
3
import os
4
import re
@@ -184,9 +185,16 @@ def try_start_docker():
184
185
)
186
if not result.stdout.strip():
187
raise RuntimeError("Docker container failed to start.")
- yield AsyncSubstrateInterface(url="ws://127.0.0.1:9944")
188
+ substrate = AsyncSubstrateInterface(url="ws://127.0.0.1:9944")
189
+ yield substrate
190
191
finally:
192
+ try:
193
+ if substrate:
194
+ asyncio.run(substrate.close())
195
+ except Exception:
196
+ logging.warning("Failed to close substrate connection.")
197
+
198
try:
199
subprocess.run(["docker", "kill", container_name])
200
process.wait(timeout=10)
0 commit comments