Skip to content

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented May 12, 2016

Since we switched to python3, it is now possible to set a timeout for Popen.wait(). 60 seconds should be enough to cleanly exit?

@maflcko maflcko added the Tests label May 12, 2016
@laanwj
Copy link
Member

laanwj commented May 12, 2016

Concept ACK, this avoids an infinite wait / travis timeout.
What happens if the deadline is not met? Is there a clear exception?

@maflcko
Copy link
Member Author

maflcko commented May 12, 2016

Depends on how you run the tests:

  • Running them directly will give you:
subprocess.TimeoutExpired: Command '['bitcoind', '-datadir=/tmp/testh6waqi5c/node0', '-server']' timed out after 60 seconds
$ echo $?
1
  • Running them through the wrapper gives:
subprocess.TimeoutExpired: Command '['/home/marco/workspace/bitcoin/qa/rpc-tests/walletbackup.py', '--srcdir=/home/marco/workspace/bitcoin/src', '--portseed=0']' timed out after 3 seconds
$ echo $?
1

Edit: For the wrapper: As there is no traceback printed (of the actual timeout in the python test), one could add a help message to the wrapper saying something like: "Some processes may be still running. Make sure to kill any bitcoind subprocesses before running further tests. To inspect the traceback, run the command mentioned above in the TimeoutExpired Exception from your command line." But I consider this out of scope for this pull.

@jtimon
Copy link
Contributor

jtimon commented May 20, 2016

utACK fab5233

@laanwj
Copy link
Member

laanwj commented May 20, 2016

Oops forgot about this
utACK fab5233

@maflcko maflcko merged commit fab5233 into bitcoin:master May 20, 2016
maflcko pushed a commit that referenced this pull request May 20, 2016
fab5233 [qa] test_framework: Set wait-timeout for bitcoind procs (MarcoFalke)
@maflcko maflcko deleted the Mf1605-qaUtilTimeout branch May 20, 2016 15:34
codablock pushed a commit to codablock/dash that referenced this pull request Dec 21, 2017
…d procs

fab5233 [qa] test_framework: Set wait-timeout for bitcoind procs (MarcoFalke)
sickpig pushed a commit to sickpig/BitcoinUnlimited that referenced this pull request Mar 12, 2018
Core QA cherries

bitcoin/bitcoin#8047 - [qa] test_framework: Set wait-timeout for bitcoind procs
bitcoin/bitcoin#8095 - Test framework: only cleanup on successful test runs
bitcoin/bitcoin#8214 - [qa] mininode: fail on send_message instead of silent return
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
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.

3 participants