Skip to content

test(receipt): cover concurrent body snapshots#151

Merged
Desperado merged 1 commit into
mainfrom
fix/receipt-egress-reviewed
Jul 15, 2026
Merged

test(receipt): cover concurrent body snapshots#151
Desperado merged 1 commit into
mainfrom
fix/receipt-egress-reviewed

Conversation

@Desperado

Copy link
Copy Markdown
Contributor

Summary

  • add race-enabled coverage for hashingBody snapshots during concurrent reads
  • verify the final request byte count, SHA-256 digest, and EOF completion state

Context

Follow-up to the receipt egress hardening merged in #150. This PR contains only the remaining regression test that was not part of the merge.

Validation

  • go test -race ./internal/httpx
  • go test ./...
  • go vet ./...

@sigilix

sigilix Bot commented Jul 15, 2026

Copy link
Copy Markdown

Sigilix Overview

Effort: 2/5 (small)

Quality gates

  • ✅ PR title follows convention
  • ✅ PR description is complete
  • ℹ️ PR is linked to an issue — No Closes #N / Closes SIG-N keyword found in PR body or commit messages.

Summary — latest push

Adds a race-enabled test to verify that hashingBody snapshot calls during concurrent reads do not corrupt the final byte count, SHA-256 digest, or EOF completion state. This regression test directly validates the concurrency hardening introduced in #150. The specialist review flagged zero findings and approved, confirming the change is safe to merge.

Important files

File Score Notes Next step
internal/httpx/httpx_test.go 3/5 Introduces TestHashingBodySnapshotConcurrentWithRead, which races 1000 snapshot calls against a goroutine draining the body to EOF, then asserts final digest and byte count integrity. Extract the 64KB test body and expected digest into named test variables to clarify intent and reduce repetition if the fixture is reused.

Confidence: 5/5

The change is a pure addition of a targeted concurrency regression test with no production code modifications and a clean specialist approval.

  • Verify that the hashingBody.snapshot() method is documented as safe for concurrent use, given this test now locks in that guarantee.
  • Confirm the 1000-iteration snapshot loop provides sufficient contention to catch races, rather than just passing due to goroutine scheduling luck.

Suggested labels: test


Posted · cfc7275 · 0 findings — View review
Dismiss @sigilix dismiss <reason> (not-a-bug | bad-anchor | already-covered | too-minor | wrong-context) · Re-run /sigilix review
Sigilix · 4 of 50 reviews used in past 5h

@qualitymaxapp

qualitymaxapp Bot commented Jul 15, 2026

Copy link
Copy Markdown

❌ QualityMax Pipeline

Gate Result
🔍 AI Review ✅ Clean
🧪 Repo Tests ❌ 472/473 passed (go)
🤖 AI Tests ✅ 47/51 passed

Powered by QualityMax — AI-Powered Test Automation

@Desperado
Desperado merged commit 39463fd into main Jul 15, 2026
5 of 7 checks passed
@Desperado
Desperado deleted the fix/receipt-egress-reviewed branch July 15, 2026 23:03
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.

1 participant