Skip to content
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

Better support Hardhat tests in --parallel mode #645

Closed
frangio opened this issue Aug 29, 2022 · 3 comments · Fixed by #726
Closed

Better support Hardhat tests in --parallel mode #645

frangio opened this issue Aug 29, 2022 · 3 comments · Fixed by #726

Comments

@frangio
Copy link
Contributor

frangio commented Aug 29, 2022

In Parallel mode, each thread gets its own Hardhat Network instance, yet they all have the same chain id so they use the same manifest file. I don't think this will cause errors with the manifest file because due to being a development network we basically ignore the contents if they don't match expectations, but it will for sure cause unnecessary contention and lead to errors such as NomicFoundation/hardhat#3093.

This should probably be fixed along with #465, by detecting different instances and using a different manifest file for each.

@frangio
Copy link
Contributor Author

frangio commented Aug 29, 2022

Note: There is currently no built-in way to uniquely identify Hardhat Network instances. We could use process.pid as a workaround untill that exists.

@Ramarti
Copy link

Ramarti commented Oct 7, 2022

+1

  2) Forta
       "before all" hook for "check deployment":
     Error: Lock file is already being held
      at /home/somedude/workspace/forta-token/node_modules/proper-lockfile/lib/lockfile.js:68:47
      at callback (node_modules/graceful-fs/polyfills.js:306:20)
      at FSReqCallback.oncomplete (node:fs:199:5)

@frangio
Copy link
Contributor Author

frangio commented Nov 30, 2022

There is now a way to implement this with the hardhat_metadata RPC method: NomicFoundation/hardhat#3382.

Haven't found docs but here's the type that will be returned by the RPC method:

https://github.com/NomicFoundation/hardhat/blob/5cecb9692ca8bfa4a57a592e3233b24336da6e1c/packages/hardhat-core/src/internal/core/jsonrpc/types/output/metadata.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants