[SERVER-49863] ServiceContext time sources should either be all mocked or all unmocked Created: 24/Jul/20  Updated: 02/Feb/23

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Benjamin Caimano (Inactive) Assignee: Backlog - Service Architecture
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-48650 Unit tests' ServiceContext's NetworkI... Closed
Assigned Teams:
Service Arch
Participants:

 Description   

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

Show all

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.



 Comments   
Comment by Lauren Lewis (Inactive) [ 21/Dec/21 ]

We haven’t heard back from you in at least 1 year, so I'm going to close this ticket. If this is still an issue for you, please provide additional information and we will reopen the ticket.

Generated at Thu Feb 08 05:21:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.