tests fixes

This commit is contained in:
master
2026-01-27 08:23:42 +02:00
parent c305d05d32
commit 82caceba56
58 changed files with 651 additions and 312 deletions

View File

@@ -23,7 +23,7 @@ public sealed class HlcTimestampJsonConverter : JsonConverter<HlcTimestamp>
{
if (reader.TokenType == JsonTokenType.Null)
{
throw new JsonException("Cannot convert null value to HlcTimestamp");
return default;
}
if (reader.TokenType != JsonTokenType.String)

View File

@@ -106,8 +106,9 @@ public sealed class HybridLogicalClock : IHybridLogicalClock
_logger = logger;
_maxClockSkew = maxClockSkew ?? TimeSpan.FromMinutes(1);
// Initialize to current physical time
_lastPhysicalTime = _timeProvider.GetUtcNow().ToUnixTimeMilliseconds();
// Initialize to 0 so first Tick() will advance physical time and reset counter
// This follows the standard HLC algorithm where l starts at 0
_lastPhysicalTime = 0;
_logicalCounter = 0;
_logger.LogInformation(