Skip to content

Commit a7f527f

Browse files
zyzniewski-reefzyzniewski
authored andcommitted
Merge branch 'staging' into tests/zyzniewski/test_set_weights
2 parents 4ecaff2 + 3ff743a commit a7f527f

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

.github/workflows/e2e-subtensor-tests.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ jobs:
4949
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
5050

5151
- name: Pull Docker Image
52-
run: docker pull ghcr.io/opentensor/subtensor-localnet:latest
52+
run: docker pull ghcr.io/opentensor/subtensor-localnet:devnet-ready
5353

5454
- name: Save Docker Image to Cache
55-
run: docker save -o subtensor-localnet.tar ghcr.io/opentensor/subtensor-localnet:latest
55+
run: docker save -o subtensor-localnet.tar ghcr.io/opentensor/subtensor-localnet:devnet-ready
5656

5757
- name: Upload Docker Image as Artifact
5858
uses: actions/upload-artifact@v4

tests/e2e_tests/conftest.py

+14-3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@
1818
Templates,
1919
setup_wallet,
2020
)
21+
import logging
22+
23+
logging.basicConfig(
24+
format="%(asctime)s %(message)s",
25+
level=logging.DEBUG,
26+
)
27+
28+
LOCALNET_IMAGE_NAME = "ghcr.io/opentensor/subtensor-localnet:devnet-ready"
2129

2230

2331
def wait_for_node_start(process, timestamp=None):
@@ -43,7 +51,9 @@ def wait_for_node_start(process, timestamp=None):
4351
# To prevent the buffer filling up
4452
def read_output():
4553
while True:
46-
if not process.stdout.readline():
54+
line = process.stdout.readline()
55+
56+
if not line:
4757
break
4858

4959
reader_thread = threading.Thread(target=read_output, daemon=True)
@@ -132,6 +142,7 @@ def is_docker_running():
132142
stderr=subprocess.DEVNULL,
133143
check=True,
134144
)
145+
subprocess.run(["docker", "pull", LOCALNET_IMAGE_NAME], check=True)
135146
return True
136147
except subprocess.CalledProcessError:
137148
return False
@@ -141,6 +152,7 @@ def try_start_docker():
141152
try:
142153
subprocess.run(["open", "-a", "Docker"], check=True) # macOS
143154
except (FileNotFoundError, subprocess.CalledProcessError):
155+
return True
144156
try:
145157
subprocess.run(["systemctl", "start", "docker"], check=True) # Linux
146158
except (FileNotFoundError, subprocess.CalledProcessError):
@@ -162,7 +174,6 @@ def try_start_docker():
162174
return False
163175

164176
container_name = f"test_local_chain_{str(time.time()).replace(".", "_")}"
165-
image_name = "ghcr.io/opentensor/subtensor-localnet:devnet-ready"
166177

167178
# Command to start container
168179
cmds = [
@@ -175,7 +186,7 @@ def try_start_docker():
175186
"9944:9944",
176187
"-p",
177188
"9945:9945",
178-
image_name,
189+
LOCALNET_IMAGE_NAME,
179190
params,
180191
]
181192

tests/e2e_tests/test_set_weights.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,14 @@ async def test_set_weights_uses_next_nonce(local_chain, subtensor, alice_wallet)
113113
netuid,
114114
uids=weight_uids,
115115
weights=weight_vals,
116-
wait_for_inclusion=True, # Don't wait for inclusion, we are testing the nonce when there is a tx in the pool
116+
wait_for_inclusion=False, # Don't wait for inclusion, we are testing the nonce when there is a tx in the pool
117117
wait_for_finalization=False,
118118
)
119119

120120
assert success is True, message
121121

122122
# Wait for the txs to be included in the chain
123-
await wait_epoch(subtensor, netuid=netuids[-1], times=4)
123+
await wait_epoch(subtensor, netuid=netuids[-1], times=2)
124124

125125
for netuid in netuids:
126126
# Query the Weights storage map for all three subnets

0 commit comments

Comments
 (0)