Expand Upload Operation Race And Backend-Parity Tests
Priority
P1
Type
testing
Labels
Suggested GitHub labels:
Branch scope
- Current branch:
develop
- Current HEAD:
a5a29a9645195e149ed0c5d75cbffa5172dd9a7d
- Target branch, if known:
develop
- Reviewed branch/ref, if applicable:
not applicable
- Reviewed commit SHA, if applicable:
not applicable
- Target release/version, if applicable:
not applicable
- Scope classification:
follow-up-after-merge
- Scope note: This draft was generated from the branch above. Revalidate against the target branch before creating or closing public GitHub issues if the branch has moved or has not yet merged.
Summary
Add shared upload-operation and metadata-backend tests for the concurrency and parity cases that remain documented as expected before production-cluster use.
Context
The current backend implements complete-upload Idempotency-Key support and optional PostgreSQL metadata, but the docs still call out additional expected tests before recommending production-cluster use. docs/postgresql-metadata-migration.md lists shared repository contract tests, HTTP handler tests, concurrency tests for upload versus close/completion, duplicate chunk races, token revocation, and restore-style validation. docs/cluster-safe-upload-semantics.md also lists backend tests for same chunk identity with different ciphertext, future staging cleanup safety, and upload versus incident close or stream completion.
Existing closed work includes PostgreSQL support, the PostgreSQL CI path, idempotency support, and duplicate reconciliation. This draft should extend coverage without redesigning those features.
Proposed change
Create focused tests that exercise the current metadata repository boundary and HTTP upload path across SQLite by default and PostgreSQL when SAFE_POSTGRES_TEST_DSN is available.
Include race or interleaving coverage for upload versus incident close, upload versus stream completion, duplicate same-identity uploads, idempotency replay, idempotency conflict, token revocation behavior, and completed bundle reconstruction after backend-specific metadata writes.
Acceptance criteria
Tests / validation
Out of scope
- Implementing resumable uploads, upload leases, or operation-level Valkey coordination.
- Exposing
/v1 publicly.
- Changing chunk identity, bundle format, or key custody.
- Adding Docker Compose or cloud services just to run the default test suite.
Notes
Relevant docs: docs/postgresql-metadata-migration.md, docs/cluster-safe-upload-semantics.md, docs/security-model.md, docs/threat-model.md.
Related completed issues: #93, #131, #132, and #137.
Expand Upload Operation Race And Backend-Parity Tests
Priority
P1
Type
testing
Labels
Suggested GitHub labels:
backloggotestingBranch scope
developa5a29a9645195e149ed0c5d75cbffa5172dd9a7ddevelopnot applicablenot applicablenot applicablefollow-up-after-mergeSummary
Add shared upload-operation and metadata-backend tests for the concurrency and parity cases that remain documented as expected before production-cluster use.
Context
The current backend implements complete-upload
Idempotency-Keysupport and optional PostgreSQL metadata, but the docs still call out additional expected tests before recommending production-cluster use.docs/postgresql-metadata-migration.mdlists shared repository contract tests, HTTP handler tests, concurrency tests for upload versus close/completion, duplicate chunk races, token revocation, and restore-style validation.docs/cluster-safe-upload-semantics.mdalso lists backend tests for same chunk identity with different ciphertext, future staging cleanup safety, and upload versus incident close or stream completion.Existing closed work includes PostgreSQL support, the PostgreSQL CI path, idempotency support, and duplicate reconciliation. This draft should extend coverage without redesigning those features.
Proposed change
Create focused tests that exercise the current metadata repository boundary and HTTP upload path across SQLite by default and PostgreSQL when
SAFE_POSTGRES_TEST_DSNis available.Include race or interleaving coverage for upload versus incident close, upload versus stream completion, duplicate same-identity uploads, idempotency replay, idempotency conflict, token revocation behavior, and completed bundle reconstruction after backend-specific metadata writes.
Acceptance criteria
SAFE_POSTGRES_TEST_DSNis configured.Tests / validation
gofmt -w ./cmd ./internal ./migrations, if Go files changego test ./..., if code changesgo vet ./..., if code changes or CI/testing changesSAFE_POSTGRES_TEST_DSN='<test dsn>' go test ./internal/postgresdb -count=1, if PostgreSQL tests changeOut of scope
/v1publicly.Notes
Relevant docs:
docs/postgresql-metadata-migration.md,docs/cluster-safe-upload-semantics.md,docs/security-model.md,docs/threat-model.md.Related completed issues:
#93,#131,#132, and#137.