hardhat icon indicating copy to clipboard operation
hardhat copied to clipboard

Communication via socket for test child processes' user interruptions

Open antico5 opened this issue 6 months ago • 1 comments

This is a WIP/exploration PR. Some feedback/polishing may be needed.

This addresses the issue where node test child processes can't deal with user input, which e.g. prevents users from typing the keystore master password.

This proposed solution uses a file socket to communicate between child test processes and the main process runner, so when they need user input (requestSecretInput hook for now), it gets forwarded to the main process and the response is sent back.

This implementation is somewhat naive but has room for extension if it's approved. For now I added caching based on interrupter plugin and prompt, so the master password isn't requested once for each child process.

antico5 avatar Jun 12 '25 14:06 antico5

🦋 Changeset detected

Latest commit: f022c7a987ae8612ec24ecbd4f9f40e5d748bc3c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 21 packages
Name Type
@nomicfoundation/hardhat-node-test-runner Patch
hardhat Patch
@nomicfoundation/hardhat-errors Patch
@nomicfoundation/hardhat-ethers-chai-matchers Patch
@nomicfoundation/hardhat-ignition Patch
@nomicfoundation/ignition-core Patch
@nomicfoundation/hardhat-ignition-ethers Patch
@nomicfoundation/ignition-ui Patch
@nomicfoundation/hardhat-ignition-viem Patch
@nomicfoundation/hardhat-keystore Patch
@nomicfoundation/hardhat-mocha Patch
@nomicfoundation/hardhat-network-helpers Patch
@nomicfoundation/hardhat-node-test-reporter Patch
@nomicfoundation/hardhat-test-utils Patch
@nomicfoundation/hardhat-typechain Patch
@nomicfoundation/hardhat-utils Patch
@nomicfoundation/hardhat-toolbox-mocha-ethers Patch
@nomicfoundation/hardhat-verify Patch
@nomicfoundation/hardhat-viem Patch
@nomicfoundation/hardhat-viem-assertions Patch
@nomicfoundation/hardhat-zod-utils Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Jun 12 '25 14:06 changeset-bot[bot]

After discussion, we are going to close this PR - it help us understand the problem, but we intend to take a simpler approach to the child process context for user interruptions (initially just throwing an error).

kanej avatar Jun 24 '25 09:06 kanej