diff --git a/.github/workflows/e2e-subtensor-tests.yaml b/.github/workflows/e2e-subtensor-tests.yaml index 08e8c2606f..81576ffeef 100644 --- a/.github/workflows/e2e-subtensor-tests.yaml +++ b/.github/workflows/e2e-subtensor-tests.yaml @@ -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=$? @@ -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..." diff --git a/tests/e2e_tests/test_staking.py b/tests/e2e_tests/test_staking.py index 55afa58beb..dddd9d1af1 100644 --- a/tests/e2e_tests/test_staking.py +++ b/tests/e2e_tests/test_staking.py @@ -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" ) @@ -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 @@ -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):