-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CT-2393] [Bug] On MacOS, running dbt functional tests fails with errors opening files #7316
Comments
Thanks for reporting this @ezraerb ! Trying out these instructions with macOS 12.6 worked fine for me the first time I tried it. Here are the limits my system reported: $ ulimit -n
1048575 $ launchctl limit maxfiles
maxfiles 256 unlimited But after adjusting the file descriptor limit down by running If we were to add a note in the testing section about the need for a high open file descriptor limit, do you have any suggestions for what that note would say? I'm going to re-label this as an |
I'm a little concerned about why the tests need so many open file descriptors, since they (hopefully) don't actually open that many resources at once. Are descriptors leaking somewhere? Since the issue has such an obvious work-around, I suspect the full fix to be a very low priority. The method to raise the file descriptor limit varies by OS, so I would go with a generic description of the issue and its workaround: "Running functional tests can fail with repeated errors opening files and other resources. If this occurs, check directory permissions and the limit on open file descriptors. The latter needs to be at least 8000." If the wording is acceptable, I'm happy to submit a PR with the change. |
That language would work for a PR 👍 Our integration testing framework uses pytest to create and run stand-alone dbt projects. There's probably hundreds of these. One way to see more useful error messages:
|
I'll submit the PR to document the workaround, and leave this ticket open for the fuller investigation. |
PR submitted for the workaround note: #7343 |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days. |
Here's the workaround within dbt-duckdb within soft_limit, hard_limit = resource.getrlimit(resource.RLIMIT_NOFILE)
resource.setrlimit(resource.RLIMIT_NOFILE, (hard_limit, hard_limit)) |
Is this a new bug in dbt-core?
Current Behavior
I downloaded a new clone of the dbt-core repository. It has no edits. Running 'make integration' runs approximately 17% of the tests, and then all tests fail. The error logs contain a mixture of seemingly unrelated errors: warnings can not be written to the log file, the sqllte file used by coverage can not be opened, and others. Lots of trial and error finally revealed that the running the tests is exceeding the open file descriptor (soft) limit. On MacOS, this limit is only 256.
Expected Behavior
Either the integration tests run without error on a newly created clone of the repository, or CONTRIBUTING.md has a note in the testing section about the need for a high open file descriptor limit.
Steps To Reproduce
Unlike step 3 above, 'pytest tests/functional' produces a clear error message that the file descriptor limit has been hit.
Relevant log output
No response
Environment
Which database adapter are you using with dbt?
postgres
Additional Context
No response
The text was updated successfully, but these errors were encountered: