From 4d67af51ab30e1dd445759472aa567c63f58efe7 Mon Sep 17 00:00:00 2001 From: Shroominic Date: Thu, 11 Dec 2025 10:08:45 +0800 Subject: [PATCH] rm shaky test --- tests/integration/test_performance_load.py | 40 ---------------------- 1 file changed, 40 deletions(-) diff --git a/tests/integration/test_performance_load.py b/tests/integration/test_performance_load.py index 581553b9..e5e5c3ce 100644 --- a/tests/integration/test_performance_load.py +++ b/tests/integration/test_performance_load.py @@ -142,46 +142,6 @@ class TestPerformanceBaseline: f" P99: {sorted(response_times)[int(len(response_times) * 0.99)]:.2f}ms" ) - @pytest.mark.asyncio - async def test_database_query_performance( - self, integration_session: Any, db_snapshot: Any - ) -> None: - """Test database operation performance""" - from sqlmodel import select - - from routstr.core.db import ApiKey - - # Create test data - for i in range(100): - key = ApiKey( - hashed_key=f"test_key_{i}", - balance=1000000, - total_spent=0, - total_requests=0, - ) - integration_session.add(key) - await integration_session.commit() - - # Test query performance - query_times = [] - - for _ in range(100): - start = time.time() - result = await integration_session.execute( - select(ApiKey).where(ApiKey.balance > 0) # type: ignore[arg-type] - ) - _ = result.all() - duration = (time.time() - start) * 1000 - query_times.append(duration) - - # All queries should complete < 100ms - assert max(query_times) < 100, ( - f"Max query time {max(query_times)}ms exceeds 100ms limit" - ) - print("\nDatabase query performance:") - print(f" Mean: {statistics.mean(query_times):.2f}ms") - print(f" Max: {max(query_times):.2f}ms") - @pytest.mark.integration @pytest.mark.slow