rails: Errno::ENAMETOOLONG on system test screenshot

Steps to reproduce

Have a sufficiently long series of describes/contexts such that their combined name causes the error. One example from my app is

Errno::ENAMETOOLONG:
              File name too long @ rb_sysopen - /home/circleci/project/tmp/screenshots/failures_r_spec_example_groups_client_exports_a_csv_of_exceptions_by_visiting_the_exception_report_page_and_clicking_export_to_csv_and_filling_out_the_export_form_with_valid_information_and_clicking_download_downloads_a_file_named_"exception_report_csv"_599.png

Expected behavior

Screenshot should save successfully in some fashion without error - maybe by truncating the name?

Actual behavior

Errno::ENAMETOOLONG error and no screenshot saved.

System configuration

Rails version: 5.1.5

Ruby version: 2.5.0

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 26 (23 by maintainers)

Most upvoted comments

An update was made in rspec-rails v 3.8.2 to further truncate system test file names which accounts for the failures_ prepended to the name. This should no longer be an issue for rspec-rails users, but will still need to be fixed for those using other testing frameworks.

Reopening because we need to do something