Skip to content

Conversation

@hackartisan
Copy link
Member

Takes code functionality back to before #6952 and #6942
closes #7014

Takes code functionality back to before #6952 and #6942
closes #7014
Copy link
Contributor

@tpendragon tpendragon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I was wrong that we should do this, #6950 wasn't about downtime

@tpendragon
Copy link
Contributor

tpendragon commented Jan 29, 2026

@hackartisan To expand - I think this test needs to stick around and we have to handle it, but not with Timeout:

https://github.com/pulibrary/figgy/pull/6952/changes#diff-47cde1abdae56a7d342411365549239303cbe875667972d8af767ae0a37ba28eR41-R65

So I think we can, in fact, remove Timeout.

Comment on lines -41 to -65
context "when reading from the primary adapter fails" do
it "falls back to the fallback adapter" do
allow(Rails.logger).to receive(:warn)
resource = ScannedResource.new(id: SecureRandom.uuid)
# Put the file in both places.
uploaded_file = primary_adapter.upload(file: file, original_filename: "foo.jpg", resource: resource)
new_path = Pathname.new(uploaded_file.disk_path.to_s.gsub(Figgy.config["repository_path"], Figgy.config["fallback_repository_path"]))
FileUtils.mkdir_p(new_path.parent)
FileUtils.cp(uploaded_file.disk_path, new_path)

file_double = instance_double(File)
allow(file_double).to receive(:read) do
# This is what happens when Tigerdata has a database entry, but can't
# connect to the Isilon. It can get File.size and File.stat, but
# reading any bytes errors.
raise Errno::EIO
end
allow(File).to receive(:open).and_call_original
allow(File).to receive(:open).with(uploaded_file.disk_path, "rb").and_yield(file_double)

reloaded_uploaded_file = storage_adapter.find_by(id: uploaded_file.id)
expect(reloaded_uploaded_file.id).to eq uploaded_file.id
expect(Rails.logger).to have_received(:warn).with(/Disk adapter used fallback for /)
end
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to keep this test.

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.

Remove timeout code introduced in #6952

3 participants