NomicFoundation / hardhat

Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software.
https://hardhat.org
Other
7.33k stars 1.42k forks source link

Add follow up tests for hook handler lazy loading race conditions #5902

Open kanej opened 4 weeks ago

kanej commented 4 weeks ago

We merged in a bug fix for some race conditions in some of our dynamic import patterns: https://github.com/NomicFoundation/hardhat/pull/5899

We need to add integration tests to cover the bug: https://github.com/NomicFoundation/hardhat-v3-alpha-testing/blob/8bf0bf69b6207a979ba16f59a13c8ee9f6c17a35/viem-provider-error/test/Lock.ts#L6

Specifically adding a second describe block that makes a second connection and uses it can cause issues where a race condition means both networks have the same network id (leading to incorrect accessing of cached data by network id).

alcuadrado commented 4 weeks ago

We may not be able to create a deterministic and stable test. We were a bit lucky with the two describes.

kanej commented 3 weeks ago

Lets timebox the investigation here to 2hrs.