Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Anvil subprocess hangs writing stdout #1758

Closed
jaeaster opened this issue Sep 30, 2022 · 1 comment · Fixed by #1759
Closed

Anvil subprocess hangs writing stdout #1758

jaeaster opened this issue Sep 30, 2022 · 1 comment · Fixed by #1759
Labels
bug Something isn't working

Comments

@jaeaster
Copy link
Contributor

jaeaster commented Sep 30, 2022

Version

└── ethers v0.17.0 (https://github.com/gakonst/ethers-rs#b2fc9fdf)
    ├── ethers-addressbook v0.17.0 (https://github.com/gakonst/ethers-rs#b2fc9fdf)
    │   ├── ethers-core v0.17.0 (https://github.com/gakonst/ethers-rs#b2fc9fdf)
    ├── ethers-contract v0.17.0 (https://github.com/gakonst/ethers-rs#b2fc9fdf)
    │   ├── ethers-contract-abigen v0.17.0 (https://github.com/gakonst/ethers-rs#b2fc9fdf)
    │   │   ├── ethers-core v0.17.0 (https://github.com/gakonst/ethers-rs#b2fc9fdf) (*)
    │   ├── ethers-contract-derive v0.17.0 (proc-macro) (https://github.com/gakonst/ethers-rs#b2fc9fdf)
    │   │   ├── ethers-contract-abigen v0.17.0 (https://github.com/gakonst/ethers-rs#b2fc9fdf) (*)
    │   │   ├── ethers-core v0.17.0 (https://github.com/gakonst/ethers-rs#b2fc9fdf) (*)
    │   ├── ethers-core v0.17.0 (https://github.com/gakonst/ethers-rs#b2fc9fdf) (*)
    │   ├── ethers-providers v0.17.0 (https://github.com/gakonst/ethers-rs#b2fc9fdf)
    │   │   ├── ethers-core v0.17.0 (https://github.com/gakonst/ethers-rs#b2fc9fdf) (*)
    ├── ethers-core v0.17.0 (https://github.com/gakonst/ethers-rs#b2fc9fdf) (*)
    ├── ethers-etherscan v0.17.0 (https://github.com/gakonst/ethers-rs#b2fc9fdf)
    │   ├── ethers-core v0.17.0 (https://github.com/gakonst/ethers-rs#b2fc9fdf) (*)
    ├── ethers-middleware v0.17.0 (https://github.com/gakonst/ethers-rs#b2fc9fdf)
    │   ├── ethers-contract v0.17.0 (https://github.com/gakonst/ethers-rs#b2fc9fdf) (*)
    │   ├── ethers-core v0.17.0 (https://github.com/gakonst/ethers-rs#b2fc9fdf) (*)
    │   ├── ethers-etherscan v0.17.0 (https://github.com/gakonst/ethers-rs#b2fc9fdf) (*)
    │   ├── ethers-providers v0.17.0 (https://github.com/gakonst/ethers-rs#b2fc9fdf) (*)
    │   ├── ethers-signers v0.17.0 (https://github.com/gakonst/ethers-rs#b2fc9fdf)
    │   │   ├── ethers-core v0.17.0 (https://github.com/gakonst/ethers-rs#b2fc9fdf) (*)
    ├── ethers-providers v0.17.0 (https://github.com/gakonst/ethers-rs#b2fc9fdf) (*)
    ├── ethers-signers v0.17.0 (https://github.com/gakonst/ethers-rs#b2fc9fdf) (*)
    └── ethers-solc v0.17.0 (https://github.com/gakonst/ethers-rs#b2fc9fdf)
        ├── ethers-core v0.17.0 (https://github.com/gakonst/ethers-rs#b2fc9fdf) (*)
├── ethers v0.17.0 (https://github.com/gakonst/ethers-rs#b2fc9fdf) (*)

Platform
21.6.0 Darwin Kernel Version 21.6.0: arm64

Description
I have tests that spawn an anvil process and make a lot of rpc calls.

When using warn-level logging, which suppresses the stdout of rpc calls, my tests run fine.
When using info logging, my tests hang awaiting a response from anvil that never arrives.

Dropping the stdout handle for the anvil subprocess fixes my issue.

See related issue for more details: foundry-rs/foundry#3414

@jaeaster jaeaster added the bug Something isn't working label Sep 30, 2022
@mattsse
Copy link
Collaborator

mattsse commented Sep 30, 2022

thanks for checking.

proposing dropping the stdout handle when we return Anvil instance as the fix, we don't need it anyway.

do you want to take this on?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants