fix(test): use a real snapshot version in presign integration tests#113
Merged
Conversation
The presign --snapshot-version tests hardcoded a snapshot timestamp (2025-12-16) that predates the freshly-created test object. The storage SDK resolves --snapshot-version by finding an object version <= the snapshot version, so no version qualified and the CLI exited 1. Take a real snapshot after creating the object and presign against its version, mirroring the existing ls/stat snapshot tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ovaistariq
approved these changes
Jun 22, 2026
himank
approved these changes
Jun 22, 2026
|
🎉 This PR is included in version 3.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The two presign
--snapshot-versionintegration tests fail on the push-triggered CI run (example) withexpected 1 to be +0— the CLI exits1instead of0.They hardcoded a snapshot version
1765889000501544464(=2025-12-16T12:43:20Z), butpresign-test.txtis created fresh inbeforeAllat test runtime. The storage SDK resolves--snapshot-versionby finding an object version withversionId <= snapshotVersion; the freshly-created object's version always post-dates the hardcoded timestamp, so no version qualifies and the SDK returnsObject "presign-test.txt" did not exist at snapshot version ....It went unnoticed until now because the integration job only runs on
push/workflow_dispatch(notpull_request), so the test had never actually executed before.Fix
Take a real snapshot of
testBucketafter creating the object and presign against its version, mirroring the existingls/statsnapshot tests. The snapshot version now post-dates the object, so resolution succeeds.Verification
tsc --noEmit,npm run lint,npm run format:checkall pass.🤖 Generated with Claude Code
Note
Low Risk
Test-only change in integration setup; no production CLI or SDK behavior is modified.
Overview
Fixes flaky/failing presign integration tests that passed a hardcoded
--snapshot-versionwhilepresign-test.txtis created at runtime. Snapshot resolution needs an object version ≤ the snapshot version, so the fixed timestamp could never match a fresh object and the CLI exited with an error.The presign
beforeAllnow takes a snapshot after creating the object and reads the version fromsnapshots list --format json, then uses that value in the--snapshot-version,--snapshot, and PUT-rejection cases—same pattern as other snapshot integration tests.Reviewed by Cursor Bugbot for commit c5e4aef. Bugbot is set up for automated code reviews on this repo. Configure here.