-
Notifications
You must be signed in to change notification settings - Fork 92
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
pyfakefs conflicts with fasteners on file locking: bad file descriptor #645
Comments
Thank you for the report! This does not look like an easy one. From your callstack I can see that fasteners use |
Thank you for the prompt response ! On my side, I managed to comment some code in my test suite, and the bug doesn't trigger anymore, so that's a workaround for now.
No worries, take your time to get a good understanding of the issue, and how to apply a fix, I'm not in a hurry. I love pyfakefs, i've built my test suite on top of it, and it's just awesome 🙂 |
Thank you 😄 |
@Wenzel - I decided to make the minimum solution by just patching away the |
@mrbean-bremen I confirm that the fix works on my project in Github Actions. 🙂 |
Good to hear! Fixed in master, closing. |
@mrbean-bremen i'd rather use an official patch release than rely on the github repo, if that's not too much of a problem for you =) |
Ok, not a problem - the release is out now. |
Describe the bug
While working on my library based on apache-libcloud, I used the
local
provider to use the filesystem as an object storage.While I wanted to mix this with pyfakefs in my unit test, this resulted in a bad file descriptor error in the test teadown, with a potential conflict between the fasteners library and pyfakefs logic.
How To Reproduce
Surprisingly, I found this bug only when running my test suite on Github Actions.
Running it on my laptop works fine, and I have no clue at this point with the Python environment would be different in Github Actions.
I build a small repository for you to test this issue and have a 100% repro:
https://github.com/Wenzel/test_bug_pyfaefs_github_actions/tree/test
(Please note the
test
branch where from which I have opened a pull request to trigger Github Actions and have a repro)I created 2 tests:
test_fake_fs
test_no_fake_fs
Each one will use a fixture to create a libcloud object storage driver based on the
local
provider (filesystem), but one of them also uses pyfakefs, instead of the real filesystem.When the fake filesystem is used, the teardown fails, as you can see below. (But only on Github Actions ❓ ❗ )
This is the stacktrace that I get on Github Actions:
Your environment
My local environment
I hope you have enough information at this point to better understand / investigate the bug.
Feel free to ask for more context !
Thank you for maintaining pyfakefs 🙂
The text was updated successfully, but these errors were encountered: