NodeClockContext, which adds one second to the current time.
Hmm, nice catch. Though, this is not something to rely on. I added the ++, because I was thinking that the wall clock may proceed to the next second here (or even to the second next second, if the scheduler is really borked). Though, on a second thought, this may be more confusing than helpful, because it likely won't help to trigger any bug. So I guess it could make sense to remove the ++ again.
Also, unrelated from that, to make this test case as strict as possible, the fake node clock context should be created before the connection is created. Otherwise, it may include a non-deterministic and larger delay than intended. Suggested diff:
diff --git a/src/test/denialofservice_tests.cpp b/src/test/denialofservice_tests.cpp
index 9709eacd8b..875c42ae55 100644
--- a/src/test/denialofservice_tests.cpp
+++ b/src/test/denialofservice_tests.cpp
@@ -266,2 +266,3 @@ BOOST_FIXTURE_TEST_CASE(block_relay_only_eviction, OutboundTest)
+ NodeClockContext clock_ctx{};
// Add an extra block-relay-only peer breaking the limit (mocks logic in ThreadOpenConnections)
@@ -276,3 +277,2 @@ BOOST_FIXTURE_TEST_CASE(block_relay_only_eviction, OutboundTest)
- NodeClockContext clock_ctx{};
clock_ctx += MINIMUM_CONNECT_TIME;