Commit 1c7105b
committed
Actually exercise the OIP cached-key retry in tests
The "cached-key retry emits one measurement, not two" step had two
weaknesses. First, it primed the cache with rsaPublicKey2, a
CryptographicKey rather than a Multikey, so `fetchKey()` skipped the
cache entirely and went straight to a fresh fetch. The retry path
inside verifyProofInternal was never triggered; the test passed
because verification.duration count was 1 either way.
Swap the cached value to ed25519Multikey (a valid Ed25519 Multikey
for a different key) so `fetchKey()` returns it as `cached=true`,
the Ed25519 algorithm check passes, and the "signature failed with
cached key" recursive retry actually runs.
Second, the step only checked verification.duration; the per-fetch
behavior on the same path was unchecked. Add assertions for the
two `activitypub.signature.key_fetch.duration` measurements the
retry produces: `result=hit` for the stale cached attempt followed
by `result=fetched` for the refetch, mirroring the LD cached-key
retry test added earlier in this PR.
#769 (comment)
Assisted-by: Claude Code:claude-opus-4-71 parent b3d2090 commit 1c7105b
1 file changed
Lines changed: 22 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
663 | 663 | | |
664 | 664 | | |
665 | 665 | | |
666 | | - | |
667 | | - | |
668 | | - | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
669 | 671 | | |
670 | | - | |
| 672 | + | |
671 | 673 | | |
672 | 674 | | |
673 | 675 | | |
| |||
690 | 692 | | |
691 | 693 | | |
692 | 694 | | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
693 | 711 | | |
694 | 712 | | |
695 | 713 | | |
| |||
0 commit comments