Skip to content

AddAsync/GetAsync/UpdateExpiryAsync throw on a DateTimeOffset expiry at or near now #668

Description

@imperugo

Found while reviewing #664. Pre-existing on master, not introduced by that PR.

Symptom

AddAsyncDateTimeOffset_WithTags_CorrectTaggedKey_Async passes as part of the full suite but fails when run in isolation:

dotnet test -f net10.0                      # 1754/1754 pass
dotnet test -f net10.0 --filter "FullyQualifiedName~AddAsyncDateTimeOffset_WithTags_CorrectTaggedKey_Async"
# 6 of 7 serializer variants fail, reproducible across runs

Only the first serializer variant passes; the rest fail consistently, which points at state left behind by whichever test ran before rather than at timing.

Why it matters

Test parallelization is disabled and all tests share one Redis instance, so this kind of coupling stays invisible until someone runs a filtered subset — exactly what you do when debugging a single failure. It also means a green full-suite run is not proof that the test actually asserts what it claims.

Likely cause

The tag Set key is probably not fully cleaned between variants, so the assertion passes on residue from a previous test rather than on what the test itself wrote. Worth checking the FlushDbAsync placement in CacheClientTestBase against the tag-related keys.

Acceptance criteria

  • The test passes both in the full suite and when run alone with --filter
  • Any sibling tag tests with the same coupling are fixed alongside it

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions