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
Owner
No description provided.
gsadmin added 2 commits 2026-06-05 02:41:54 +00:00
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).
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
bf641d662d
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.
gsadmin merged commit feb4cf3b7c into main 2026-06-05 02:42:01 +00:00
Sign in to join this conversation.