Skip to content

Commit cda1e7c

Browse files
authored
Merge pull request #2849 from opentensor/fix/roman/more-attempts-to-e2e-tests
Add one more attempt to e2e tests
2 parents c331bf0 + 51187fe commit cda1e7c

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107
- name: Run tests with retry
108108
run: |
109109
set +e
110-
for i in 1 2; do
110+
for i in 1 2 3; do
111111
echo "🔁 Attempt $i: Running tests"
112112
uv run pytest ${{ matrix.test-file }} -s
113113
status=$?
@@ -116,8 +116,8 @@ jobs:
116116
break
117117
else
118118
echo "❌ Tests failed on attempt $i"
119-
if [ $i -eq 2 ]; then
120-
echo "Tests failed after 2 attempts"
119+
if [ $i -eq 3 ]; then
120+
echo "Tests failed after 3 attempts"
121121
exit 1
122122
fi
123123
echo "Retrying..."

tests/e2e_tests/test_staking.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,13 +424,17 @@ def test_safe_staking_scenarios(subtensor, alice_wallet, bob_wallet):
424424
rate_tolerance=0.005, # 0.5%
425425
allow_partial_stake=False,
426426
)
427-
assert success is False
427+
assert success is False, "Unstake should fail."
428428

429429
current_stake = subtensor.get_stake(
430430
alice_wallet.coldkey.ss58_address,
431431
bob_wallet.hotkey.ss58_address,
432432
netuid=alice_subnet_netuid,
433433
)
434+
435+
logging.console.info(f"[orange]Current stake: {current_stake}[orange]")
436+
logging.console.info(f"[orange]Full stake: {full_stake}[orange]")
437+
434438
assert current_stake == full_stake, (
435439
"Stake should not change after failed unstake attempt"
436440
)
@@ -454,6 +458,7 @@ def test_safe_staking_scenarios(subtensor, alice_wallet, bob_wallet):
454458
bob_wallet.hotkey.ss58_address,
455459
netuid=alice_subnet_netuid,
456460
)
461+
logging.console.info(f"[orange]Partial unstake: {partial_unstake}[orange]")
457462
assert partial_unstake > Balance(0), "Some stake should remain"
458463

459464
# 3. Higher threshold - should succeed fully
@@ -468,7 +473,7 @@ def test_safe_staking_scenarios(subtensor, alice_wallet, bob_wallet):
468473
rate_tolerance=0.3, # 30%
469474
allow_partial_stake=False,
470475
)
471-
assert success is True
476+
assert success is True, "Unstake should succeed"
472477

473478

474479
def test_safe_swap_stake_scenarios(subtensor, alice_wallet, bob_wallet):

0 commit comments

Comments
 (0)