[tests] Make p2p-leaktests.py more robust#11078
Conversation
|
Happened again on Travis. This seems to have become more common: |
test/functional/p2p-leaktests.py
Outdated
There was a problem hiding this comment.
Making things more robust by adding sleeps w/out checks is kind of meh (as things can be terribly laggy). Can it check this precondition somehow and sleep longer if necessary?
fc70754 to
a53b395
Compare
yes, you're right - it's meh, and in this case it was a red herring. I've managed to work out what was going wrong. When the [conn.disconnect_node() for conn in connections]in a reasonably fast environment, the test will continue and add the new allowed_service_bit5_node.add_connection(connections[5])before the old In a slower environment (Travis), the So it's kind of the opposite of what I thought. The solution is to restart the thread with I've also added a |
a53b395 to
fb56824
Compare
test/functional/p2p-leaktests.py
Outdated
There was a problem hiding this comment.
I've seen this test fail locally with high -j on a system with slow I/O at this assert, I assume this patch will help, though I was unable to reproduce reliably to test :(.
fb56824 to
0063d2c
Compare
|
This is still causing occasional failures on Travis. @MarcoFalke - any chance of review/merge? |
|
@jnewbery Thanks for the ping. I ignored the pull because I assumed it still had the ugly |
|
utACK 0063d2c |
0063d2c [tests] Make p2p-leaktests.py more robust (John Newbery) Pull request description: There has been an example of p2p-leaktests.py failing on travis in the new service bits test (introduced in #11001 . It appeared to me that the previous p2p connections had not been fully disconnected before attempting to add new p2p connections. I've added a sleep and restarted the NetworkThread, but I don't know whether this will fix the problem, since I'm unable to reproduce the failure locally. @MarcoFalke - not sure what you want to do here? I don't think this change could make things any worse. Tree-SHA512: f5427c26267185a903c9b75bb3925bf153b8afce70c8e493bf8f585f57d809d20643b4ee69081300b211d22e960242aecc3d719f4ddd230aa08fdc5484b55055
Github-Pull: bitcoin#11078 Rebased-From: 0063d2c
0063d2c [tests] Make p2p-leaktests.py more robust (John Newbery) Pull request description: There has been an example of p2p-leaktests.py failing on travis in the new service bits test (introduced in bitcoin#11001 . It appeared to me that the previous p2p connections had not been fully disconnected before attempting to add new p2p connections. I've added a sleep and restarted the NetworkThread, but I don't know whether this will fix the problem, since I'm unable to reproduce the failure locally. @MarcoFalke - not sure what you want to do here? I don't think this change could make things any worse. Tree-SHA512: f5427c26267185a903c9b75bb3925bf153b8afce70c8e493bf8f585f57d809d20643b4ee69081300b211d22e960242aecc3d719f4ddd230aa08fdc5484b55055
0063d2c [tests] Make p2p-leaktests.py more robust (John Newbery) Pull request description: There has been an example of p2p-leaktests.py failing on travis in the new service bits test (introduced in bitcoin#11001 . It appeared to me that the previous p2p connections had not been fully disconnected before attempting to add new p2p connections. I've added a sleep and restarted the NetworkThread, but I don't know whether this will fix the problem, since I'm unable to reproduce the failure locally. @MarcoFalke - not sure what you want to do here? I don't think this change could make things any worse. Tree-SHA512: f5427c26267185a903c9b75bb3925bf153b8afce70c8e493bf8f585f57d809d20643b4ee69081300b211d22e960242aecc3d719f4ddd230aa08fdc5484b55055
There has been an example of p2p-leaktests.py failing on travis in the new service bits test (introduced in #11001 . It appeared to me that the previous p2p connections had not been fully disconnected before attempting to add new p2p connections.
I've added a sleep and restarted the NetworkThread, but I don't know whether this will fix the problem, since I'm unable to reproduce the failure locally.
@MarcoFalke - not sure what you want to do here? I don't think this change could make things any worse.