Skip to content

Conversation

meshcollider
Copy link
Contributor

@meshcollider meshcollider commented Oct 5, 2021

After #17211 was merged, there have been a few intermittent test failures in wallet_send.py, rpc_fundrawtransaction.py, and rpc_psbt.py

I believe all these failures are due to these missing sync_all()s

@achow101
Copy link
Member

achow101 commented Oct 5, 2021

rpc_psbt.py has a similar potential issue.

@meshcollider
Copy link
Contributor Author

Added rpc_psbt.py and addressed @jonatack's suggestion

@achow101
Copy link
Member

achow101 commented Oct 5, 2021

ACK 6b1b715

The lack of sync_all has bitten us in the past in similar situations, so it's likely to be the problem here.

@meshcollider
Copy link
Contributor Author

Sorry to invalidate your ACK immediately @achow101, just included the two other instances of node.generate that @jonatack pointed out so they're all gone.

@achow101
Copy link
Member

achow101 commented Oct 5, 2021

ACK 75a9305

@instagibbs
Copy link
Member

the idea being block processing hasn't finished before the wallet calls are used, even though it's on the same node?

@meshcollider
Copy link
Contributor Author

meshcollider commented Oct 5, 2021

the idea being block processing hasn't finished before the wallet calls are used, even though it's on the same node?

It is for the benefit of the other node, using the input externally. For example, in rpc_fundrawtransaction.py, the node called wallet is the one calling fundrawtransaction, after nodes[0] generates the transaction and blocks. Similarly, in wallet_send.py, ext_wallet needs to be synced after nodes[0] generates the transaction and blocks.

@@ -1010,7 +1010,8 @@ def test_external_inputs(self):

self.nodes[0].sendtoaddress(addr, 10)
self.nodes[0].sendtoaddress(wallet.getnewaddress(), 10)
self.nodes[0].generate(6)
self.generate(self.nodes[0], 6)
self.sync_all()
Copy link
Member

@instagibbs instagibbs Oct 6, 2021

Choose a reason for hiding this comment

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

slight preference for syncing right before the other wallet call rather than sandwiched between nodes[0] calls. This makes spotting gaps easier in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@instagibbs #22567 will merge these sync_all into the generate calls, so it makes sense to put them together for clarity at the moment IMO

Copy link
Contributor

Choose a reason for hiding this comment

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

@instagibbs PR #22741 has more information about the generate* calls

@instagibbs
Copy link
Member

instagibbs commented Oct 6, 2021 via email

Copy link
Contributor

@lsilva01 lsilva01 left a comment

Choose a reason for hiding this comment

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

Tested ACK 75a9305 on Ubuntu 20.04

sync_all() ensures that blocks and mempool will be synchronized between nodes.
Tests were run several times without errors.

@DrahtBot
Copy link
Contributor

DrahtBot commented Oct 6, 2021

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #23202 (wallet: allow psbtbumpfee to work with txs with external inputs by achow101)
  • #23201 (wallet: Allow users to specify input weights when funding a transaction by achow101)

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.

@meshcollider meshcollider deleted the 202110_fix_external_tests branch October 6, 2021 12:19
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Oct 6, 2021
…pc_fundrawtransaction.py

75a9305 Fix intermittent test failures due to missing sync_all (Samuel Dobson)
eb02dbb Use self.generate not node.generate throughout tests (Samuel Dobson)

Pull request description:

  After bitcoin#17211 was merged, there have been a few intermittent test failures in `wallet_send.py`, `rpc_fundrawtransaction.py`, and `rpc_psbt.py`

  I believe all these failures are due to these missing `sync_all()`s

ACKs for top commit:
  achow101:
    ACK 75a9305
  lsilva01:
    Tested ACK bitcoin@75a9305 on Ubuntu 20.04

Tree-SHA512: 91de5763664046e5a35802eb1a9a28f69a1a27d78d26c9fa0024bcfab4ccb4b7ad4feebea7de4b19e141db9c39270c623c57c47942a48dfe679fdc8cad70df43
@bitcoin bitcoin locked and limited conversation to collaborators Oct 30, 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.

7 participants