-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Can't run multiple forge script
in parallel
#2884
Comments
Even if that would be fixed, I'm not sure it would be okay to run them in parallel if you're using them with
what is your usecase? |
Yup, I'm not running broadcast on the same chain! Talking to multiple anvil instances at the same time (running tests in parallel). edit: to expand on your comment: shouldn't it be both 1) and 2)? If just 1), then you have unnecessary waiting. If just 2), then you have failures whenever a lock is on. Also, about the |
@adhusson Is this still an issue? I think I was just able to get two scripts running (seemingly) in parallel, as I did not get the |
@mds1 : I've just done foundryup, but I still have the issue. Starting the following in 7 parallel processes gives the
The port number of course differs in each process. Foundry up:
|
Note: After playing around to make a smaller example it turns out that forge script is not enough to make it fail - but prefixing it with anvil_setCode cheatcode is, so here is a repro with the
|
Thanks! I was able to reproduce this with the above steps |
Can't reproduce this anymore. Scripts aren't relying on cache as heavily now, so this likely has been fixed. |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (7e9e6a5 2022-08-22T00:05:42.088216Z)
What command(s) is the bug in?
forge script
Operating System
macOS (Apple Silicon)
Describe the bug
When running tests in parallel against multiple instances of
anvil
, I start multipleforge script
s at once, and getCould not open compiler cache
on some of them.It seems reasonable to allow multiple runs in parallel, so maybe forge instances could 1) wait when the cache is locked, and 2) not lock until they know they have to write, that way they could all read a fresh cache in parallel.
The text was updated successfully, but these errors were encountered: