diff --git a/src/test/httpserver_tests.cpp b/src/test/httpserver_tests.cpp index 96d6c387676..9262a940c25 100644 --- a/src/test/httpserver_tests.cpp +++ b/src/test/httpserver_tests.cpp @@ -805,7 +805,7 @@ BOOST_AUTO_TEST_CASE(http_server_socket_tests) { // Hard code the timestamp for the Date header in the HTTP response // Wed Dec 11 00:47:09 2024 UTC - SetMockTime(1733878029); + FakeNodeClock clock{1733878029s}; // Prepare a request handler that just stores received requests so we can examine them. // Mutex is required to prevent a race between this test's main thread and the server's I/O loop. diff --git a/src/test/mempool_fee_estimator_tests.cpp b/src/test/mempool_fee_estimator_tests.cpp index 23b84b0b488..c75c7c7237b 100644 --- a/src/test/mempool_fee_estimator_tests.cpp +++ b/src/test/mempool_fee_estimator_tests.cpp @@ -105,6 +105,7 @@ BOOST_AUTO_TEST_CASE(calculate_max_weight_percentiles) BOOST_AUTO_TEST_CASE(mempool_fee_rate_estimator_cache) { + FakeNodeClock clock{}; MemPoolFeeRateEstimatorCache cache; const uint256 tip_hash{uint256::ONE}; const uint256 next_tip_hash{uint256{2}}; @@ -122,10 +123,9 @@ BOOST_AUTO_TEST_CASE(mempool_fee_rate_estimator_cache) BOOST_CHECK(cached->m_economical == economical); BOOST_CHECK(!cache.GetCachedEstimate(next_tip_hash)); - SetMockTime(GetTime() + CACHE_LIFE + std::chrono::seconds{1}); + clock += CACHE_LIFE + std::chrono::seconds{1}; BOOST_CHECK(cache.IsStale()); BOOST_CHECK(!cache.GetCachedEstimate(tip_hash)); - SetMockTime(0); } BOOST_AUTO_TEST_CASE(MempoolFeeRateEstimator)