Skip to content

Commit a10be9e

Browse files
authored
Merge pull request #2827 from opentensor/fix/roman/test_commit_reveal_v3
Replace waiting logic for `test_commit_reveal_v3.py`
2 parents 2e67a4a + bf56e08 commit a10be9e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/e2e_tests/test_commit_reveal_v3.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import re
2+
import time
23

34
import numpy as np
45
import pytest
@@ -177,8 +178,9 @@ async def test_commit_and_reveal_weights_cr3(local_chain, subtensor, alice_walle
177178
f"Latest drand round after waiting for tempo: {latest_drand_round}"
178179
)
179180

180-
# for fast-block 6 seconds (drand round period) is 12 fast blocks. Let's make sure this round passed.
181-
subtensor.wait_for_block(subtensor.block + 24)
181+
# wait until last_drand_round is the same or greeter than expected_reveal_round with sleep 3 second (as Drand round period)
182+
while expected_reveal_round >= subtensor.last_drand_round():
183+
time.sleep(3)
182184

183185
# Fetch weights on the chain as they should be revealed now
184186
revealed_weights_ = subtensor.weights(netuid=netuid)

0 commit comments

Comments
 (0)