Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public IReadOnlyList<IPrepareLogRecord<TStreamId>> CreatePrepareLogRecord(TStrea
eventType,
new byte[0],
new byte[0],
DateTime.Now,
DateTime.UtcNow,
PrepareFlags.IsCommitted
)
};
Expand Down Expand Up @@ -91,7 +91,7 @@ public IReadOnlyList<IPrepareLogRecord<TStreamId>> CreatePrepareLogRecords(TStre
eventTypes[i],
new byte[0],
new byte[0],
DateTime.Now
DateTime.UtcNow
));
}

Expand All @@ -100,7 +100,7 @@ public IReadOnlyList<IPrepareLogRecord<TStreamId>> CreatePrepareLogRecords(TStre

public CommitLogRecord CreateCommitLogRecord(long logPosition, long transactionPosition, long firstEventNumber)
{
return new CommitLogRecord(logPosition, Guid.NewGuid(), transactionPosition, DateTime.Now, 0);
return new CommitLogRecord(logPosition, Guid.NewGuid(), transactionPosition, DateTime.UtcNow, 0);
}

public void WriteToDB(IEnumerable<IPrepareLogRecord<TStreamId>> prepares)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
using EventStore.Core.Authorization;
using EventStore.Core.Authorization.AuthorizationPolicies;
using EventStore.Core.Bus;
using EventStore.Core.Messages;
using EventStore.Core.Data;
using EventStore.Core.Messages;
using EventStore.Core.Messaging;
using EventStore.Core.Services;
using EventStore.Core.TransactionLog.LogRecords;
Expand Down Expand Up @@ -415,7 +415,7 @@ private static ResolvedEvent CreateResolvedEvent(string eventType, byte[] data,
transactionOffset: 0,
SystemStreams.AuthorizationPolicyRegistryStream,
eventStreamIdSize: null,
expectedVersion: eventNumber, DateTime.Now, PrepareFlags.Data,
expectedVersion: eventNumber, DateTime.UtcNow, PrepareFlags.Data,
eventType, eventTypeSize: null, data, ReadOnlyMemory<byte>.Empty);
var eventRecord = new EventRecord(eventNumber, prepare, SystemStreams.AuthorizationPolicyRegistryStream,
eventType);
Expand Down
2 changes: 1 addition & 1 deletion src/EventStore.Core.XUnit.Tests/Index/IndexTrackerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void can_observe_prepare_logs()

private static PrepareLogRecord CreatePrepare()
{
return new PrepareLogRecord(42, Guid.NewGuid(), Guid.NewGuid(), 42, 42, "tests", null, 42, DateTime.Now,
return new PrepareLogRecord(42, Guid.NewGuid(), Guid.NewGuid(), 42, 42, "tests", null, 42, DateTime.UtcNow,
PrepareFlags.Data, "type-test", null, Array.Empty<byte>(), Array.Empty<byte>());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,17 @@ private void AssertMeasurements(string instrumentName, long? expectedValue)

private static PrepareLogRecord CreatePrepare(byte[] data, byte[] meta, long logPosition = 42)
{
return new PrepareLogRecord(logPosition, Guid.NewGuid(), Guid.NewGuid(), 42, 42, "tests", null, 42, DateTime.Now,
return new PrepareLogRecord(logPosition, Guid.NewGuid(), Guid.NewGuid(), 42, 42, "tests", null, 42, DateTime.UtcNow,
PrepareFlags.Data, "type-test", null, data, meta);
}

private static SystemLogRecord CreateSystemRecord()
{
return new SystemLogRecord(42, DateTime.Now, SystemRecordType.Epoch, SystemRecordSerialization.Binary, Array.Empty<byte>());
return new SystemLogRecord(42, DateTime.UtcNow, SystemRecordType.Epoch, SystemRecordSerialization.Binary, Array.Empty<byte>());
}

private static CommitLogRecord CreateCommit()
{
return new CommitLogRecord(42, Guid.NewGuid(), 42, DateTime.Now, 42);
return new CommitLogRecord(42, Guid.NewGuid(), 42, DateTime.UtcNow, 42);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class PrepareLogRecordViewTests
private const int TransactionOffset = 321;
private const string EventStreamId = "test_stream";
private const long ExpectedVersion = 789;
private readonly DateTime _timestamp = DateTime.Now;
private readonly DateTime _timestamp = new(DateTime.UtcNow.Ticks);
private const PrepareFlags Flags = PrepareFlags.SingleWrite;
private const string EventType = "test_event_type";
private readonly byte[] _data = { 0xDE, 0XAD, 0xC0, 0XDE };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static PrepareLogRecord CreatePrepareLogRecord(int stringLength)
eventStreamId: theString,
eventStreamIdSize: null,
expectedVersion: 789,
timeStamp: DateTime.Now,
timeStamp: DateTime.UtcNow,
flags: PrepareFlags.SingleWrite,
eventType: theString,
eventTypeSize: null,
Expand All @@ -45,12 +45,12 @@ static PrepareLogRecord CreatePrepareLogRecord(int stringLength)
logPosition: 123,
correlationId: Guid.NewGuid(),
transactionPosition: 456,
timeStamp: DateTime.Now,
timeStamp: DateTime.UtcNow,
firstEventNumber: 789,
commitRecordVersion: 1);

static SystemLogRecord CreateSystemLogRecord() => new(logPosition: 123,
timeStamp: DateTime.Now,
timeStamp: DateTime.UtcNow,
systemRecordType: SystemRecordType.Epoch,
systemRecordSerialization: SystemRecordSerialization.Binary,
data: [0xDE, 0XAD, 0xC0, 0XDE]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ ClientMessage.WriteEventsCompleted WriteEvents(ClientMessage.WriteEvents message
flags |= PrepareFlags.TransactionEnd;

var record = new EventRecord(revision, position, message.CorrelationId,
current.EventId, _all.Count, i, message.EventStreamId, -1, DateTime.Now,
current.EventId, _all.Count, i, message.EventStreamId, -1, DateTime.UtcNow,
flags, current.EventType, current.Data, current.Metadata);
if (current.EventType == SystemEventTypes.LinkTo)
{
Expand Down
Loading