bitcoindevkit / bdk

A modern, lightweight, descriptor-based wallet library written in Rust!
Other
871 stars 312 forks source link

Add test troubleshooting section to README? #1723

Open riverKanies opened 1 week ago

riverKanies commented 1 week ago

tests involving bitcoind failing on mac: Error: JSON-RPC error: transport error: Couldn't connect to host: Resource temporarily unavailable (os error 35)

Found answer here after some digging: https://github.com/bitcoindevkit/bdk/issues/749#issuecomment-1247580407

RUST_TEST_THREADS=1 cargo test

To me it seems worth including this in a test section in the README.md what do y'all think?

ValuedMammal commented 1 week ago

Yeah I think it could help but I also think something like cargo nextest would be a nice solution. Basically you can configure groups of tests to run sequentially, i.e. not in parallel

notmandatory commented 1 week ago

I agree we should mention it to help people with local testing. I usually use the command cargo test -- --test-threads=1.

riverKanies commented 1 week ago

hmm, ok, I figured it was an issue specific to my environment, but thinking about it it does seem like it should be necessary to run tests that ping a blockchain client in series, so it probably does make sense to enforce that. I tried it out and it seems to work! will push a PR momentarily. thanks for the tip @ValuedMammal

riverKanies commented 1 week ago

@notmandatory should I make two separate PRs? one for the README and one to enforce running in series?

Update: went ahead and did so: https://github.com/bitcoindevkit/bdk/pull/1729 https://github.com/bitcoindevkit/bdk/pull/1728

oleonardolima commented 1 week ago

IIRC it's usually an issue on macOS, I don't remember facing it on Linux, maybe should point that out on the troubleshooting. Yes, it's a good idea to add the troubleshooting. FWIW I usually use --test-threads=2 without any problem.

notmandatory commented 1 week ago

Yes I've also only see this issue on MacOS, so best to document it in #1729. On Linux parallel testing is fine and since the CI is on Linux I'd rather not force these tests to always be done in serial, the CI already runs too slow.