Skip to content

Fix test logic: Various assertion and fixture issues #269

@anchapin

Description

@anchapin

Description

Multiple unit tests fail due to various fixture and assertion issues.

Failing Tests

Marketplace Dedup Tests

  • tests/test_marketplace_dedup.py::TestBidLockManager::test_concurrent_bids_on_different_postings - assert False (not all bids succeeded)
  • tests/test_marketplace_dedup.py::TestBidLockManager::test_lock_expiration - assert False is True
  • tests/test_marketplace_dedup.py::TestBidLockManager::test_lock_metrics - assert 0 == 1
  • tests/test_marketplace_dedup.py::TestBidLockManager::test_cleanup_expired_locks - assert 5 == 2
  • tests/test_marketplace_dedup.py::TestConcurrentBidScenarios::test_100_concurrent_bids_different_postings - assert 12 == 0

OAuth Learning Tests

  • tests/test_oauth_learning.py::TestLearningSystemIntegration::test_marketplace_comparison - assert 15 == 5

Performance Tests

  • tests/test_performance_improvements.py::TestEagerLoading::test_task_with_relationships - AttributeError: COMPLETED (likely enum comparison issue)
  • tests/test_performance_improvements.py::TestIntegration::test_full_task_flow_with_eager_loading - AttributeError: IN_PROGRESS
  • tests/test_performance_improvements.py::TestDatabaseIndexes::test_task_indexes_exist - Expected index idx_tasks_client_email not found
  • tests/test_performance_improvements.py::TestDatabaseIndexes::test_bid_indexes_exist - Expected index idx_bids_job_id not found
  • tests/test_performance_improvements.py::TestDatabaseIndexes::test_client_profile_indexes_exist - Expected index idx_client_profiles_client_email not found

Redis Rate Limiter Tests

  • tests/test_redis_rate_limiter.py::TestInMemoryFallback::test_resets_after_window - assert False is True

Secrets Tests

  • tests/test_secrets.py::TestProductionValidation::test_production_passes_with_secure_secrets - SystemExit: 1

Training Mode Simulation Tests

  • tests/test_training_mode_simulation.py::TestSimulationEngine::test_calculate_total_profit - assert 3 == 2
  • tests/test_training_mode_simulation.py::TestSimulationEngine::test_get_strategy_summary - assert 12 == 5

Root Cause

Various issues: incorrect test assertions, missing database indexes in schema, improper mock setup

Expected Fix

Review and fix each test individually - likely needs a combination of fixing test assertions and ensuring proper test fixtures.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtesting

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions