Skip to content

S3: Use the seeded random for multipart upload IDs - #10553

Open
akaab-landr wants to merge 3 commits into
getmoto:masterfrom
LandrAudio:s3-multipart-ids-from-seed
Open

akaab-landr wants to merge 3 commits into
getmoto:masterfrom
LandrAudio:s3-multipart-ids-from-seed

Conversation

@akaab-landr

Copy link
Copy Markdown

create_multipart_upload() draws its UploadId from os.urandom, so the ID changes between runs even after seeding Moto with /moto-api/seed:

requests.post("http://localhost:5000/moto-api/seed?a=42")
s3.create_multipart_upload(Bucket="b", Key="k")["UploadId"]  # differs every run

This PR uses mock_random, as other generated IDs already do.
Test: test_multipart_upload_ids_follow_the_seed.

akaab-landr and others added 3 commits November 12, 2026 15:16
FakeMultipart drew its UploadId from os.urandom, so seeding Moto through
/moto-api/seed did not make it reproducible. Use mock_random, as the other
generated IDs already do.
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