test: Drop ++ from NodeClockContext default constructor

The increment was originally added so that mocked time would not appear
to go backward relative to real-clock timestamps captured before
construction, since Now<NodeSeconds>() rounds the current time down to
a whole second. In practice the tests do not mix real and mocked
timestamps in a way that exposes this, so the increment is unnecessary.
This commit is contained in:
seduless
2026-04-17 22:51:27 +00:00
parent 7c2ec3949a
commit 758fea59a8

View File

@@ -44,8 +44,8 @@ public:
/// Initialize with the given time.
explicit NodeClockContext(NodeSeconds init_time) { set(init_time); }
explicit NodeClockContext(std::chrono::seconds init_time) { set(init_time); }
/// Initialize with current time, using the next tick to avoid going back by rounding to seconds.
explicit NodeClockContext() { set(++Now<NodeSeconds>().time_since_epoch()); }
/// Initialize with current time.
explicit NodeClockContext() { set(Now<NodeSeconds>()); }
/// Unset mocktime.
~NodeClockContext() { set(0s); }