fix(tests): eliminate UtcNow race in GetChainCertificateTargetStore_NonSelfSigned test #7

Merged
gsadmin merged 2 commits from dev into main 2026-06-05 02:42:01 +00:00

2 Commits

Author SHA1 Message Date
GraceSolutions bf641d662d Build artifacts for b438abf18f
Publish to PowerShell Gallery / build (pull_request) Failing after 37s
Publish to PowerShell Gallery / release (pull_request) Has been skipped
Publish to PowerShell Gallery / publish (pull_request) Has been skipped
Auto-generated by build.ps1 -CommitArtifacts. Build 2026.06.05.0240. Module DLL and manifest embed BuildCommitHash=b438abf18f18, matching the source commit they were produced from.
2026-06-04 22:40:31 -04:00
GraceSolutions b438abf18f fix(tests): eliminate UtcNow race in GetChainCertificateTargetStore_NonSelfSigned test
The non-self-signed chain-routing test called DateTimeOffset.UtcNow.AddDays(1)
twice -- once for the root cert and once for the intermediate cert -- so when
the wall clock ticked a second between the two calls the intermediate's
notAfter ended up later than the root's notAfter, and CertificateRequest.Create
rejected it:

  System.ArgumentException : The requested notAfter value (...:11) is later
  than issuerCertificate.NotAfter (...:10). (Parameter 'notAfter')

Capture notBefore/notAfter once at the top of the test and reuse the same
DateTimeOffset for both certificates so the intermediate's validity window
is guaranteed equal to (not later than) the issuer's.

TESTS
- 216/216 passing locally; this was reliably reproducible under CI load
  (latest failure on commit ceea76255b).
2026-06-04 22:40:20 -04:00