Skip to content

Commit 1948a8e

Browse files
joelhawksleyCopilot
andcommitted
Rescue Errno::ENOENT in system-test entrypoint controller
The Rails 8.1 CI cell intermittently fails ViewComponentSystemTest with Ferrum::PendingConnectionsError. Traced to validate_file_path raising Errno::ENOENT from File.realpath when the browser issues a late request (favicon retry, teardown screenshot) after with_rendered_component_path's ensure block has unlinked the temp file. Rescue Errno::ENOENT the same way we already rescue nefarious-path errors: return 404. The pending late request completes cleanly instead of cascading into a Ferrum timeout during teardown. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 6d92d61 commit 1948a8e

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎app/controllers/view_components_system_test_controller.rb‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def self.temp_dir
1111
end
1212

1313
rescue_from ViewComponent::SystemTestControllerNefariousPathError, with: :render_not_found
14+
rescue_from Errno::ENOENT, with: :render_not_found
1415

1516
def system_test_entrypoint
1617
render file: @path

0 commit comments

Comments
 (0)