Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/e2e-subtensor-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
- name: Run tests with retry
run: |
set +e
for i in 1 2; do
for i in 1 2 3; do
echo "🔁 Attempt $i: Running tests"
uv run pytest ${{ matrix.test-file }} -s
status=$?
Expand All @@ -116,8 +116,8 @@ jobs:
break
else
echo "❌ Tests failed on attempt $i"
if [ $i -eq 2 ]; then
echo "Tests failed after 2 attempts"
if [ $i -eq 3 ]; then
echo "Tests failed after 3 attempts"
exit 1
fi
echo "Retrying..."
Expand Down
9 changes: 7 additions & 2 deletions tests/e2e_tests/test_staking.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,13 +424,17 @@ def test_safe_staking_scenarios(subtensor, alice_wallet, bob_wallet):
rate_tolerance=0.005, # 0.5%
allow_partial_stake=False,
)
assert success is False
assert success is False, "Unstake should fail."

current_stake = subtensor.get_stake(
alice_wallet.coldkey.ss58_address,
bob_wallet.hotkey.ss58_address,
netuid=alice_subnet_netuid,
)

logging.console.info(f"[orange]Current stake: {current_stake}[orange]")
logging.console.info(f"[orange]Full stake: {full_stake}[orange]")

assert current_stake == full_stake, (
"Stake should not change after failed unstake attempt"
)
Expand All @@ -454,6 +458,7 @@ def test_safe_staking_scenarios(subtensor, alice_wallet, bob_wallet):
bob_wallet.hotkey.ss58_address,
netuid=alice_subnet_netuid,
)
logging.console.info(f"[orange]Partial unstake: {partial_unstake}[orange]")
assert partial_unstake > Balance(0), "Some stake should remain"

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


def test_safe_swap_stake_scenarios(subtensor, alice_wallet, bob_wallet):
Expand Down