Skip to content

FileUpload test race#1179

Merged
michaeldjeffrey merged 2 commits into
mainfrom
mj/fileupload-test-race
Apr 24, 2026
Merged

FileUpload test race#1179
michaeldjeffrey merged 2 commits into
mainfrom
mj/fileupload-test-race

Conversation

@michaeldjeffrey
Copy link
Copy Markdown
Contributor

There’s a chance for some of these test that we trigger a shutdown of
the daemon after a file has been processed, but before FileUpload was
able to fully upload it to s3.

Given our pattern is to look for orphaned files and try to upload them
on startup, I didn’t want to change the contract that much for currently
running services by making FileUpload wait until it’s upload channel was
complete before shutting down. So we’ve added a small counter where you
can ask it how many files have been uploaded. In a test situation that
should be a predictable thing, if there’s a case where it’s not, I can't
predict that right now and whoever runs into that will need to come up
with a better solution.

AWS Local generates bucket names based on the prefix of the test name.
Because these tests are so close together and relatively simple, there a
chance they run in the same millisecond getting the same bucket name. So
one completing before the other would cause it to fail.

Swapping the parts of the test name around I think they still read well
and avoid that problem. 

How insiduous that kind of failure could be. Add it to the least of
things I didn’t expect to see today.
Comment thread file_store/src/file_upload.rs Outdated
There’s a chance for some of these test that we trigger a shutdown of
the daemon after a file has been processed, but before FileUpload was
able to fully upload it to s3. 

Given our pattern is to look for orphaned files and try to upload them
on startup, I didn’t want to change the contract that much for currently
running services by making FileUpload wait until it’s upload channel was
complete before shutting down. So we’ve added a small counter where you
can ask it how many files have been uploaded. In a test situation that
should be a predictable thing, if there’s a case where it’s not, I can't
predict that right now and whoever runs into that will need to come up
with a better solution. 

I had a thought that mybe the watch channel would hold a map of
file_types to the number uploaded, so you could get a more granular. But
that’s not needed for me right now.

Currently playing: Angine De Poitine Vol.II
I haven’t spent much time listening to microtonal music. But it’s
giving me a weird sense of comfort right now. There are so many
unsurities flying around right now. Maybe that’s why? Who’s to know.
@michaeldjeffrey michaeldjeffrey force-pushed the mj/fileupload-test-race branch from 5f4f7c4 to 232eac1 Compare April 24, 2026 18:10
@michaeldjeffrey michaeldjeffrey merged commit 04cbdf5 into main Apr 24, 2026
29 checks passed
@michaeldjeffrey michaeldjeffrey deleted the mj/fileupload-test-race branch April 24, 2026 18:17
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