Skip to content

test: add coverage for bitcoin-cli -rpcwait#18653

Merged
maflcko merged 4 commits into
bitcoin:masterfrom
jonatack:rpcwait-test-coverage
Apr 16, 2020
Merged

test: add coverage for bitcoin-cli -rpcwait#18653
maflcko merged 4 commits into
bitcoin:masterfrom
jonatack:rpcwait-test-coverage

Conversation

@jonatack

Copy link
Copy Markdown
Member

and other coverage improvements in interface-bitcoin_cli.py

# Start node without RPC connection.
self.nodes[0].start()
# Verify failure without -rpcwait.
assert_raises_process_error(1, "Could not connect to the server", self.nodes[0].cli('getblockcount').echo)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this racy?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running (for i in {1..1000}; do test/functional/interface_bitcoin_cli.py ; done) to see.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We generally only see races in travis or valgrind

Logically, I don't see how the rpc connection is guaranteed to be down when the cli is called here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense: it ran 1000 times without fail for me in macOS and Debian, but yeah, travis and valgrind. I'll wait to see the travis result for the fun of it and then probably remove that line; we'll still have the assertion with -rpcwait

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Travis all green. Maybe leave it in and remove if we see issues later?

@DrahtBot DrahtBot added the Tests label Apr 15, 2020
Comment thread test/functional/interface_bitcoin_cli.py
@DrahtBot

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@kristapsk kristapsk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK c28c7b8

@maflcko
maflcko merged commit 661e8df into bitcoin:master Apr 16, 2020
@jonatack
jonatack deleted the rpcwait-test-coverage branch April 16, 2020 14:47
luke-jr pushed a commit to bitcoinknots/bitcoin that referenced this pull request Jun 14, 2020
in interface_bitcoin_cli.py

Github-Pull: bitcoin#18653
Rebased-From: 727b67e
luke-jr pushed a commit to bitcoinknots/bitcoin that referenced this pull request Jun 14, 2020
in interface_bitcoin_cli.py and improve/harmonize the test logging.

Github-Pull: bitcoin#18653
Rebased-From: becc8b9
luke-jr pushed a commit to bitcoinknots/bitcoin that referenced this pull request Jun 14, 2020
luke-jr pushed a commit to bitcoinknots/bitcoin that referenced this pull request Jun 14, 2020
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jan 15, 2021
Summary:
- add coverage for bitcoin-cli -rpcwait
- verify bitcoin-cli -version with node stopped and improve/harmonize the test logging.
- verify cli.getwalletinfo in wallet section
- add -getinfo "unlocked_until" and "headers" coverage

This is a backport of Core [[bitcoin/bitcoin#18653 | PR18653]]

Test Plan: `test/functional/test_runner.py interface_bitcoin*`

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D8931
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants