Skip to content

Jskinne3 lg 7653 intermittent tests 2#7159

Merged
jskinne3 merged 11 commits intomainfrom
jskinne3-LG-7653-intermittent-tests-2
Oct 18, 2022
Merged

Jskinne3 lg 7653 intermittent tests 2#7159
jskinne3 merged 11 commits intomainfrom
jskinne3-LG-7653-intermittent-tests-2

Conversation

@jskinne3
Copy link
Contributor

🎫 Ticket

LG-7653
https://cm-jira.usa.gov/browse/LG-7653

changelog: Added, README, increase file descriptor limit

🛠 Summary of changes

I added to the README some instructions for increasing limit of MacOS file descriptors. This resolves "too many open files" errors.

This is does not fix all intermittent test failures I'm experiencing -- this is just the only one I was able to conclusively fix. I suspect there is an underlying issue, like a connection which is failing to close and is not relinquishing its file descriptors.

References:

  1. Maximum limits (in macOS file descriptors) by Wilson Mar
  2. El Capitan ulimit shenanigans by Dejan Kitic
  3. "Too many open files" limit/ulimit on Mac OS X by Thomas Jung
  4. Ruby 2.7.1 - Errno::EMFILE: Failed to open TCP connection to 127.0.0.1:9*** (Too many open files - socket(2) for "127.0.0.1" port 9***) by ndbroadbent

📜 Testing Plan

Confirm if you are among the MacBooks experiencing intermittent "too many open files" errors. If you are, follow the instructions to create a limit.maxfiles.plist file. Reboot your laptop and see if the errors go away.

🚀 Notes for Deployment

None because it is just a README change

README.md Outdated
ulimit -Sn 65536
```

If you are running MacOS, you may find it is not taking your revised ulimit seriously. [Insist by](https://medium.com/mindful-technology/too-many-open-files-limit-ulimit-on-mac-os-x-add0f1bfddde) adding the following file at `/Library/LaunchDaemons/limit.maxfiles.plist` and set it to be owned by root:
Copy link
Contributor

@zachmargolis zachmargolis Oct 18, 2022

Choose a reason for hiding this comment

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

😭 I wish we didn't have to resort to this....

but as long as we're here, can we make it easier to copy paste? Like a chown command to copy? and maybe bonus like one of these cat commands to write to the file

cat > /Library/LaunchDaemons/limit.maxfiles.plist <<XML
<?xml ....
XML

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A nice idea! Sadly I think that using cat > in a directory owned by root would require interactive sudo -i login, which I have a bad feeling about. The easiest way to do it in my opinion is to use sudo to launch the editor, then paste the file contents in. I've changed the README to reflect this!

Copy link
Contributor

@theabrad theabrad Oct 18, 2022

Choose a reason for hiding this comment

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

Since this requires root access are people that use GFEs allowed to do this?

@jskinne3 jskinne3 requested review from a team and zachmargolis October 18, 2022 15:10
Why?

The capybara-selenium gem was last updated on 12/20/2014. The
functionality of that gem has been replaced by the webdrivers gem.
Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

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

LGTM, worth a shot!

group :test do
gem 'axe-core-rspec', '~> 4.2'
gem 'bundler-audit', require: false
gem 'capybara-selenium', '>= 0.0.6'
Copy link
Contributor

Choose a reason for hiding this comment

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

this is just because we no longer use selenium, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

the webdrivers gem contains all of the different webdrivers, and capybara-selenium hasn't been updated since 2014. This gem was just there to make capybara work with selenium, but that is handled with webdrivers now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Excellent! ✨ really glad to get that outdated gem outta there

@jskinne3 jskinne3 merged commit 0582d52 into main Oct 18, 2022
@jskinne3 jskinne3 deleted the jskinne3-LG-7653-intermittent-tests-2 branch October 18, 2022 20:50
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.

3 participants