diff --git a/tests/SIGCM2.Application.Tests/Infrastructure/Audit/AuditEventRepositoryTests.cs b/tests/SIGCM2.Application.Tests/Infrastructure/Audit/AuditEventRepositoryTests.cs index 4420348..c637aa6 100644 --- a/tests/SIGCM2.Application.Tests/Infrastructure/Audit/AuditEventRepositoryTests.cs +++ b/tests/SIGCM2.Application.Tests/Infrastructure/Audit/AuditEventRepositoryTests.cs @@ -129,7 +129,10 @@ public sealed class AuditEventRepositoryTests : IAsyncLifetime [Fact] public async Task QueryAsync_Limit_EmitsCursor_WhenMoreRowsAvailable() { - var t0 = DateTime.UtcNow.AddMinutes(-10); + // Determinístico: DATETIME2(3) + cursor roundtrip via "O" format puede perder ticks + // sub-ms de `DateTime.UtcNow` (observado ~37% flake rate, cursor vuelve como parentesis + // de la página anterior). Timestamp fijo con sub-ms = 0 elimina la ambigüedad. + var t0 = new DateTime(2026, 4, 19, 12, 0, 0, DateTimeKind.Utc); await Seed(5, t0); var page1 = await _repo.QueryAsync(new AuditEventFilter(null, null, null, null, null, null, Limit: 2));