-
Notifications
You must be signed in to change notification settings - Fork 83
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
Cannot unlock file "/home/runner/.cache/mongodb-binaries/5.0.7.lock", because it is not locked by this process #366
Comments
@jgcmarins you solved this? |
@EmanuelCampos not yet |
I am experiencing the same issue, which I found very weird since I have been using this for months with no errors. I tried following the mongdb-memory-server library and I think I may have found the culprit. The only place this error may be throw is at:
And Thus, I think whenever there are multiple process running, there is a chance for this to happen. I am not sure why this never happened for 5 months and is now happening a lot though... I don't know if there is a way to fix without changing mongodb-memory-server, also I am not sure why it works like that. I will attempt to make jest workers using threads instead of child process, as this hopefully will make all of them have the same PID, and hopefully I don't get errors again. I will try to update here in a few days. |
@guilherme-gm any update? i'm also struggling with this |
I've only made a few CI runs since then (~5, I think), but using 1 Child Process seems to work. Using Worker Threads instead of Child Processes did not work. It spawned several instances of mongo memory server at the same time and it was a mess. I changed back to Child Process and limited to 1 worker when running in CI. It didn't fail in the few runs I had after that and I didn't notice any major performance impact on my tests (I don't have THAT many tests, so a few extra seconds in CI was not a problem) I think this makes sense, since having a single process spawning mongo servers, running tests and shutting it down will prevent a case where another process is using the lock. But I still think it is something that should be addressed (maybe on mongodb-memory-server and not on jest-mongodb... but I am not 100% sure). I don't remember the config from the top of my head, but should be easy to find it in jest docs. I will try to update this message tomorrow once I have access to my code. Edit:
I chose to only limit in CI, since I don't have issues when running locally (so far) |
We've been experiencing some random test failures with this library and GitHub Actions.
Not sure which is causing the issue, but here's the error:
Cannot unlock file "/home/runner/.cache/mongodb-binaries/5.0.7.lock", because it is not locked by this process
The text was updated successfully, but these errors were encountered: