Skip to content

test: handle timestamp certificate rotation - #321

Open
yizha1 wants to merge 1 commit into
mainfrom
yizha1-microsoft-dependency-pr-merge
Open

yizha1 wants to merge 1 commit into
mainfrom
yizha1-microsoft-dependency-pr-merge

Conversation

@yizha1

@yizha1 yizha1 commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix the timestamp revocation test without changing production code or removing its live DigiCert request.

The test expected the exact subject of DigiCert's 2024 timestamp certificate. DigiCert now returns a different certificate, causing the test to fail even though the revoked certificate is correctly rejected. The same failure was reproduced on unchanged main before this fix.

Record the certificate marked revoked by the test validator and derive the expected error from its subject. Keep the exact error comparison, and explicitly fail if revocation validation was not reached.

Validation

  • Reproduced the original failure on main using Go 1.23.12.
  • go test -race ./internal/timestamp -count=1 passed with Go 1.23.12 and Go 1.24.13.
  • git diff --check passed.

Scope

Only internal/timestamp/timestamp_test.go changes. The test still contacts DigiCert. No dependency updates or production behavior changes are included.

Copilot AI balanced review requested due to automatic review settings October 1, 2026 16:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The focused test-only change correctly removes the stale certificate assumption without weakening error verification.

Review effort: Balanced
Findings: None

What changed in this PR

Updates the timestamp revocation test to tolerate DigiCert certificate rotation while retaining exact error validation.

Changes:

  • Captures the certificate marked revoked by the test validator.
  • Derives the expected error from the current certificate subject.
  • Explicitly verifies revocation validation occurred.
File Description
internal/​timestamp/​timestamp_test.go Makes the live DigiCert revocation test certificate-rotation-safe.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov

codecov Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.69%. Comparing base (a9c5e3f) to head (627125a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #321      +/-   ##
==========================================
+ Coverage   92.26%   92.69%   +0.42%     
==========================================
  Files          32       32              
  Lines        2806     2204     -602     
==========================================
- Hits         2589     2043     -546     
+ Misses        165      109      -56     
  Partials       52       52              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Derive the expected revocation error from the certificate marked revoked by the test validator instead of hard-coding DigiCert's 2024 certificate subject. Preserve the exact error assertion and require revocation validation to run.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Yi Zha <yizha1+microsoft@microsoft.com>
@yizha1
yizha1 force-pushed the yizha1-microsoft-dependency-pr-merge branch from 46533b0 to 627125a Compare October 1, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants