-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Text file busy flake in tests #442
Comments
Going by backtrace:
We end up at My best bet is that either it is that we are building the same contracts in two tests, so the cache/artifacts are being written at the same time, or it is SVM as you suspected. I don't see a super elegant solution, maybe using |
@mattsse this seems to align with how we've been thinking about the caching issue? I think there should be a "right" way to solve it, serial tests would be a big no-no, so let's try to brainstorm it a bit? |
so text file busy happens if a program tries to modify a file that's currently being executed or otherwise used in write mode. this could be a race condition within our svm abstraction. |
To reproduce: run I used a thread count of 32 and ran it 2 or 3 times before I encountered the failing test |
that makes a bit more sense now, |
my guess is, two tests run in parallel, both need solc x.y.z which is missing, so they both try to install it... |
Yeah that's typically what happened in the past, which I thought we had solved with a mutex in the installation step, maybe the mutex got lost during our ethers-solc refactors? |
lock in test is still there but perhaps this is an integration test issue where multiple bins are executed
|
Oh I think I've found it, I changed version detection in the new graph implementation |
I don't think an in-process mutex solves it, think we do need a lockfile. AFAIK tests are built as a special executable that Cargo just runs in parallel or something :/ |
I think adding a lockfile under ~/.svm and the artifacts dir could be a fine solution if we don't have a better one, as long as it gets cleaned up instantly and we document it nicely (it's never cool when the user needs to manually remove index/lockfiles) |
Ok, looked at it to be sure, it does not run the executable multiple times side by side. Perhaps it's just because we call other install methods than |
The println makes me believe the issue is during the svm installation step here, which proceeds to call I think the offending code is either the @MATTSE mentioned that if gakonst/ethers-rs#802 doesn't address this, we should consider using a lockfile, given that our existing mutexes in ethers-solc seem to not be getting hit |
Let's see if this finally fixes it.. |
For some reason, tests fail sometimes with the error below:
Other times it fails with this one:
I suspect this might be related to the Solc downloader trying to download a binary multiple times, and write it over an existing file? Not sure.
The text was updated successfully, but these errors were encountered: