From 0ae490efa61a9dfc960d5834837011244a2935a8 Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 17 Mar 2025 23:46:13 -0700 Subject: [PATCH 1/4] fix --- tests/e2e_tests/conftest.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/tests/e2e_tests/conftest.py b/tests/e2e_tests/conftest.py index e3625683f..f0deb8531 100644 --- a/tests/e2e_tests/conftest.py +++ b/tests/e2e_tests/conftest.py @@ -184,17 +184,9 @@ def try_start_docker(): ) if not result.stdout.strip(): raise RuntimeError("Docker container failed to start.") - - substrate = AsyncSubstrateInterface(url="ws://127.0.0.1:9944") - yield substrate + yield AsyncSubstrateInterface(url="ws://127.0.0.1:9944") finally: - try: - if substrate: - substrate.close() - except Exception: - pass - try: subprocess.run(["docker", "kill", container_name]) process.wait(timeout=10) From 47fd63557137decc2ad3f21db21d7d98baa00e47 Mon Sep 17 00:00:00 2001 From: Roman Date: Tue, 18 Mar 2025 00:23:12 -0700 Subject: [PATCH 2/4] update docker image name --- tests/e2e_tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e_tests/conftest.py b/tests/e2e_tests/conftest.py index f0deb8531..92a69f953 100644 --- a/tests/e2e_tests/conftest.py +++ b/tests/e2e_tests/conftest.py @@ -142,7 +142,7 @@ def try_start_docker(): return False container_name = f"test_local_chain_{str(time.time()).replace('.', '_')}" - image_name = "ghcr.io/opentensor/subtensor-localnet:latest" + image_name = "ghcr.io/opentensor/subtensor-localnet:devnet-ready" # Command to start container cmds = [ From c01f874cb5cfd2e980e640f97b533bc9c86c1446 Mon Sep 17 00:00:00 2001 From: Roman Date: Tue, 18 Mar 2025 00:34:32 -0700 Subject: [PATCH 3/4] do tests for all python-version --- .github/workflows/e2e-subtensor-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-subtensor-tests.yml b/.github/workflows/e2e-subtensor-tests.yml index b4dc3120f..7e3d4a1d3 100644 --- a/.github/workflows/e2e-subtensor-tests.yml +++ b/.github/workflows/e2e-subtensor-tests.yml @@ -73,7 +73,7 @@ jobs: os: - ubuntu-latest test-file: ${{ fromJson(needs.find-tests.outputs.test-files) }} - # python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] steps: - name: Check-out repository uses: actions/checkout@v4 From 1cfe029562bf0022b38c9cdf887ec58429d02fb2 Mon Sep 17 00:00:00 2001 From: Roman Date: Tue, 18 Mar 2025 09:31:15 -0700 Subject: [PATCH 4/4] apply asyncio run to async substrate.close() call --- tests/e2e_tests/conftest.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/e2e_tests/conftest.py b/tests/e2e_tests/conftest.py index 92a69f953..bf993325c 100644 --- a/tests/e2e_tests/conftest.py +++ b/tests/e2e_tests/conftest.py @@ -1,3 +1,4 @@ +import asyncio import logging import os import re @@ -184,9 +185,16 @@ def try_start_docker(): ) if not result.stdout.strip(): raise RuntimeError("Docker container failed to start.") - yield AsyncSubstrateInterface(url="ws://127.0.0.1:9944") + substrate = AsyncSubstrateInterface(url="ws://127.0.0.1:9944") + yield substrate finally: + try: + if substrate: + asyncio.run(substrate.close()) + except Exception: + logging.warning("Failed to close substrate connection.") + try: subprocess.run(["docker", "kill", container_name]) process.wait(timeout=10)