Repository navigation
test: fix rpc_setban.py race - #16656
Conversation
|
I'd rather do this without a sleep. Wouldn't creating a dummy connection and waiting for it to open synchronize as well? |
|
Maybe the better way would be to add a timeout to |
|
2 seconds are too much in my opinion. |
I am fine with either. Though, I suggest to set the default timeout for |
f2a4fea to
53714bd
Compare
|
Switch to a retry/timeout approach with no delay for existing calls. |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, 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. |
53714bd to
6bdd6a0
Compare
|
0.05 seconds are definitely better. |
6bdd6a0 to
6292311
Compare
|
Sorry about that. Concept ACK, |
|
@jonasschnelli the |
Why? I guess we can get a fresh file position as well... |
|
@jonasschnelli no you don't. What you want to say is:
|
|
@NicolasDorier |
|
just discovered it myself. I wonder why we don't have this in C#... will complain to Microsoft. :p |
6292311 to
c3ce574
Compare
|
Fixed @NicolasDorier's point. |
c3ce574 to
cd4a903
Compare
There was a problem hiding this comment.
no need for this. python doesn't have scope blocks
There was a problem hiding this comment.
This will print only the last message
cd4a903 to
6011c9d
Compare
6011c9d QA: fix rpc_setban.py race (Jonas Schnelli) Pull request description: The new `rpc_setban.py` test failes regularly on CIs due to a race between injecting the ban and testing the log "on the other side". The problem is, that the test immediately after the `addnode` command on node0 checks for the `dropped (banned)` entry on node1 (without giving some time). Adding a 2 seconds sleep seems to solve the race (I guess there is no better event-driven delay). Example of a failed test: https://bitcoinbuilds.org/index.php?ansilog=bf743910-103f-4b54-9a97-960c471061bd.log#l2906 Top commit has no ACKs. Tree-SHA512: 680f8ea3e5ddb07e93f824f1aeff4a459e25e6c14715a39fc7670e50506d7cf25925348672c5c2d8ba3e1243ccf5effbc2456bcd094fb96868349f8d26e008f1
|
ACK |
Summary: This is a backport of Core [[bitcoin/bitcoin#16656 | PR16656]] Depends on D5935 Test Plan: ninja all check-all Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D5936
Summary: This is a backport of Core [[bitcoin/bitcoin#16656 | PR16656]] Depends on D5935 Test Plan: ninja all check-all Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D5936
6011c9d QA: fix rpc_setban.py race (Jonas Schnelli) Pull request description: The new `rpc_setban.py` test failes regularly on CIs due to a race between injecting the ban and testing the log "on the other side". The problem is, that the test immediately after the `addnode` command on node0 checks for the `dropped (banned)` entry on node1 (without giving some time). Adding a 2 seconds sleep seems to solve the race (I guess there is no better event-driven delay). Example of a failed test: https://bitcoinbuilds.org/index.php?ansilog=bf743910-103f-4b54-9a97-960c471061bd.log#l2906 Top commit has no ACKs. Tree-SHA512: 680f8ea3e5ddb07e93f824f1aeff4a459e25e6c14715a39fc7670e50506d7cf25925348672c5c2d8ba3e1243ccf5effbc2456bcd094fb96868349f8d26e008f1
The new
rpc_setban.pytest failes regularly on CIs due to a race between injecting the ban and testing the log "on the other side".The problem is, that the test immediately after the
addnodecommand on node0 checks for thedropped (banned)entry on node1 (without giving some time).Adding a 2 seconds sleep seems to solve the race (I guess there is no better event-driven delay).
Example of a failed test: https://bitcoinbuilds.org/index.php?ansilog=bf743910-103f-4b54-9a97-960c471061bd.log#l2906