Remove outdated GPU marketplace endpoint and fix staking service logic
- Remove duplicate `/marketplace/gpu/{gpu_id}` endpoint from marketplace_gpu.py
- Remove marketplace_gpu router inclusion from main.py (already included elsewhere)
- Fix staking service staker_count logic to check existing stakes before increment/decrement
- Add minimum stake amount validation (100 AITBC)
- Add proper error handling for stake not found cases
- Fix staking pool update to commit and refresh after modifications
- Update CLI send_transaction to use chain
This commit is contained in:
@@ -6,8 +6,7 @@ Tests Prometheus metrics, alerting, and SLA monitoring systems
|
||||
import pytest
|
||||
import requests
|
||||
import time
|
||||
import json
|
||||
from datetime import datetime, timedelta
|
||||
from datetime import datetime, timedelta, timezone
|
||||
from typing import Dict, Any
|
||||
|
||||
class TestPrometheusMetrics:
|
||||
@@ -501,10 +500,10 @@ class TestMonitoringIntegration:
|
||||
assert uptime_diff < 1.0, f"Uptime difference {uptime_diff} exceeds tolerance of 1.0 second"
|
||||
|
||||
# Check timestamps are recent
|
||||
summary_time = datetime.fromisoformat(summary["timestamp"].replace('Z', '+00:00'))
|
||||
system_time = datetime.fromisoformat(system["timestamp"].replace('Z', '+00:00'))
|
||||
summary_time = datetime.fromisoformat(summary["timestamp"].replace('Z', '+00:00')).replace(tzinfo=timezone.utc)
|
||||
system_time = datetime.fromisoformat(system["timestamp"].replace('Z', '+00:00')).replace(tzinfo=timezone.utc)
|
||||
|
||||
now = datetime.utcnow()
|
||||
now = datetime.now(timezone.utc)
|
||||
assert (now - summary_time).total_seconds() < 60 # Within last minute
|
||||
assert (now - system_time).total_seconds() < 60 # Within last minute
|
||||
|
||||
|
||||
Reference in New Issue
Block a user