The replica cache integration tests fail on develop since snapshots measure their age with a monotonic counter #437

Closed
opened 2026-11-13 21:32:42 -05:00 by claude · 0 comments
Owner

Run 1618 (push to develop, merge of #434, commit d0323bcd) failed in Test .NET:

  • PostgreSqlReplicaCacheTests.RewriteCache_AfterTheTimeToLive_ReloadsFromTheReplica
  • MySqlReplicaCacheTests.RewriteCache_AfterTheTimeToLive_ReloadsFromTheReplica
  • MongoDbReplicaCacheTests.RewriteCache_AfterTheTimeToLive_ReloadsFromTheReplica

all with A time-to-live reload must read the replica. (ReplicaCacheTestsBase.cs line 226).

Cause

#224 changed RefreshingSnapshot to measure the age of a value with TimeProvider.GetTimestamp / GetElapsedTime. The SteppingTimeProvider in ReplicaCacheTestsBase only overrides GetUtcNow, so stepping it no longer ages the snapshot and the time-to-live reload never starts. The failure is deterministic, not a flake.

The pull-request pipeline of #434 did not see it: these tests carry RequiresDocker and only run on a push to a long-lived branch.

Fix

SteppingTimeProvider overrides TimestampFrequency and GetTimestamp from the same hand-stepped clock, as the ManualTimeProvider fakes changed in #224 do. Test-only change; the product code is correct.

Run 1618 (push to `develop`, merge of #434, commit d0323bcd) failed in **Test .NET**: - `PostgreSqlReplicaCacheTests.RewriteCache_AfterTheTimeToLive_ReloadsFromTheReplica` - `MySqlReplicaCacheTests.RewriteCache_AfterTheTimeToLive_ReloadsFromTheReplica` - `MongoDbReplicaCacheTests.RewriteCache_AfterTheTimeToLive_ReloadsFromTheReplica` all with `A time-to-live reload must read the replica.` (`ReplicaCacheTestsBase.cs` line 226). ## Cause #224 changed `RefreshingSnapshot` to measure the age of a value with `TimeProvider.GetTimestamp` / `GetElapsedTime`. The `SteppingTimeProvider` in `ReplicaCacheTestsBase` only overrides `GetUtcNow`, so stepping it no longer ages the snapshot and the time-to-live reload never starts. The failure is deterministic, not a flake. The pull-request pipeline of #434 did not see it: these tests carry `RequiresDocker` and only run on a push to a long-lived branch. ## Fix `SteppingTimeProvider` overrides `TimestampFrequency` and `GetTimestamp` from the same hand-stepped clock, as the `ManualTimeProvider` fakes changed in #224 do. Test-only change; the product code is correct.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lantea-one/ninlil#437
No description provided.