Skip to content

Commit 8596c29

Browse files
author
Roman
committed
add is_subnet_active check to e2e tests
1 parent 3edd650 commit 8596c29

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/e2e_tests/utils/e2e_test_utils.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def validator(self, wallet, netuid):
229229

230230

231231
def wait_to_start_call(
232-
subtensor: "bittensor.Subtensor",
232+
subtensor: "bittensor.SubtensorApi",
233233
subnet_owner_wallet: "bittensor.Wallet",
234234
netuid: int,
235235
in_blocks: int = 10,
@@ -242,6 +242,11 @@ def wait_to_start_call(
242242
f"Current block: [blue]{subtensor.block}[/blue]."
243243
)
244244

245+
# make sure subnet isn't active
246+
assert subtensor.subnets.is_subnet_active(netuid) is False, (
247+
"Subnet is already active."
248+
)
249+
245250
# make sure we passed start_call limit
246251
subtensor.wait_for_block(subtensor.block + in_blocks + 1)
247252
status, message = subtensor.start_call(
@@ -251,6 +256,11 @@ def wait_to_start_call(
251256
wait_for_finalization=True,
252257
)
253258
assert status, message
259+
# make sure subnet is active
260+
assert subtensor.subnets.is_subnet_active(netuid), (
261+
"Subnet did not activated after start call."
262+
)
263+
254264
return True
255265

256266

0 commit comments

Comments
 (0)