Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-49863

ServiceContext time sources should either be all mocked or all unmocked

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Server Programmability

      There are a number of tests and fixtures that set ClockSourceMock and/or TickSourceMock ad hoc:

      src/mongo/db/ftdc/ftdc_test.cpp
      src/mongo/db/logical_clock_test_fixture.cpp
      src/mongo/db/operation_context_test.cpp
      src/mongo/db/repl/initial_syncer_test.cpp
      src/mongo/db/repl/oplog_applier_impl_test.cpp
      src/mongo/db/repl/replication_coordinator_test_fixture.cpp
      src/mongo/db/s/migration_chunk_cloner_source_legacy_test.cpp
      src/mongo/db/s/namespace_metadata_change_notifications_test.cpp
      src/mongo/db/s/transaction_coordinator_test.cpp
      src/mongo/db/s/vector_clock_config_server_test.cpp
      src/mongo/db/s/vector_clock_shard_server_test.cpp
      src/mongo/db/session_catalog_mongod_test.cpp
      src/mongo/db/transaction_participant_test.cpp
      src/mongo/db/vector_clock_mongod_test.cpp
      src/mongo/dbtests/cursor_manager_test.cpp
      src/mongo/dbtests/dbtests.cpp
      src/mongo/s/catalog/replset_dist_lock_manager_test.cpp
      src/mongo/s/commands/cluster_command_test_fixture.cpp
      src/mongo/s/mongos_topology_coordinator_test.cpp
      src/mongo/s/sharding_router_test_fixture.cpp
      src/mongo/s/transaction_router_test.cpp
      src/mongo/transport/service_state_machine_test.cpp
      src/mongo/util/diagnostic_info_test.cpp
      src/mongo/util/fail_point_test.cpp
      src/mongo/util/future_util_test.cpp
      

      When any time sources are set on the ServiceContext, they should all be set at once. When they are mocked, they should likely be set to the same underlying shared source. It is possible but not certain that tests should be utilizing features of the ServiceContextTest in some form to set clock sources in general. I suspect that we will find a few testing bugs if we do this work.

            Assignee:
            Unassigned Unassigned
            Reporter:
            ben.caimano@mongodb.com Benjamin Caimano (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: