Commit graph

31 commits

Author SHA1 Message Date
MarcoFalke
564e1ab0f3
Merge #19800: test: Mockwallet
fa188c9c59 test: Use MiniWalet in p2p_feefilter (MarcoFalke)
fa39c62eb7 test: inline hashToHex (MarcoFalke)

Pull request description:

  This introduces a minimalistic test wallet, which can be used as a drop in replacement for the Bitcoin Core wallet to create dummy transactions with a given fee rate.

ACKs for top commit:
  jnewbery:
    utACK fa188c9c59

Tree-SHA512: 0aad9cb14eea4f0055bd6a47cc8c8f82a16941b152598c3bf1e083aae84cca4ffa23f0b854a362a68be1b917deba1b5ec7c0207b63b0805d747ba9a7d1d82efe
2020-09-09 09:06:22 +02:00
MarcoFalke
fa188c9c59
test: Use MiniWalet in p2p_feefilter 2020-09-07 15:06:24 +02:00
Seleme Topuz
1343c86c7c test: Update wait_until usage in tests not to use the one from utils
Replace "wait_until()" usage from utils, with the ones from BitcoinTestFramework and P2PInterface.
closes #19080
2020-08-26 18:01:59 +02:00
MarcoFalke
fa39c62eb7
test: inline hashToHex 2020-08-25 14:27:25 +02:00
John Newbery
5e8df3312e test: resort imports 2020-08-21 15:53:59 +01:00
John Newbery
85165d4332 scripted-diff: Rename mininode to p2p
-BEGIN VERIFY SCRIPT-
sed -i 's/\.mininode/\.p2p/g' $(git grep -l "mininode")
git mv test/functional/test_framework/mininode.py test/functional/test_framework/p2p.py
-END VERIFY SCRIPT-
2020-08-21 15:52:20 +01:00
John Newbery
9e2897d020 scripted-diff: Rename mininode_lock to p2p_lock
-BEGIN VERIFY SCRIPT-
sed -i 's/mininode_lock/p2p_lock/g' $(git grep -l "mininode_lock")
-END VERIFY SCRIPT-
2020-08-21 15:52:13 +01:00
Sebastian Falbesoner
9e7894357e test: speedup p2p_feefilter.py by whitelisting peers (immediate tx relay)
Most of the test time is spent in wait_for_invs() after sending to addresses,
i.e. the bottleneck is in relaying transactions. By whitelisting the peers via
-whitelist, the inventory is transmissioned immediately rather than on average
every 5 seconds, speeding up the test significantly:

before:
$ time ./p2p_feefilter.py
...
real    0m39.367s
user    0m1.227s
sys 0m0.571s

with this commit:
$ time ./p2p_feefilter.py
...
real    0m9.386s
user    0m1.120s
sys 0m0.577s
2020-08-12 22:38:09 +02:00
Sebastian Falbesoner
fe3f0cc44e test: use wait_until for invs matching in p2p_feefilter.py
additionally:
    -> rename function with snake_case (s/allInvsMatch/wait_for_invs_to_match)
    -> move it from global namespace to the class FeefilterConn
2020-08-12 22:30:38 +02:00
Sebastian Falbesoner
6d941923c3 test: add logging for p2p_feefilter.py 2020-08-12 22:21:38 +02:00
Sebastian Falbesoner
dac7a111bd refactor: test: use _ variable for unused loop counters
substitutes "for x in range(N):" by "for _ in range(N):"
indicates to the reader that a block is just repeated N times, and
that the loop counter is not used in the body
2020-08-06 18:39:33 +02:00
Fabian Jahr
cacd85209e test: Use wtxid relay generally in functional tests 2020-07-19 02:10:42 -04:00
MarcoFalke
faabd1514f
test: Check that peers with forcerelay permission do not get a feefilter message 2020-06-21 12:17:55 -04:00
MarcoFalke
ffff3fe50a
test: Replace self.nodes[0].p2p with conn 2020-06-21 11:35:44 -04:00
MarcoFalke
faccdc8a31
test: remove redundant generate
setup_nodes takes care of getting out of ibd
2020-06-21 11:35:35 -04:00
MarcoFalke
fab83b934a
test: pep-8 p2p_feefilter.py 2020-06-21 11:35:25 -04:00
Sebastian Falbesoner
eeaaa58d2c test: replace inv type magic numbers by constants 2020-05-07 14:34:55 +02:00
Gregory Sanders
eb7b781659 modify p2p_feefilter test to catch rounding error 2019-10-03 14:03:27 -04:00
MarcoFalke
fafe5f0d09
test: Remove unused imports 2019-04-09 12:10:35 -04:00
MarcoFalke
fa16a09215
scripted-diff: use self.sync_* methods
-BEGIN VERIFY SCRIPT-
sed -i -e 's/sync_blocks(self.nodes)/self.sync_blocks()/g'     $(git grep -l 'sync_blocks(self.nodes)'   ./test/functional/*.py)
sed -i -e 's/sync_mempools(self.nodes)/self.sync_mempools()/g' $(git grep -l 'sync_mempools(self.nodes)' ./test/functional/*.py)

sed -i -e 's/  sync_blocks(/  self.sync_blocks(/g'     $(git grep -l sync_blocks   ./test/functional/*.py)
sed -i -e 's/  sync_mempools(/  self.sync_mempools(/g' $(git grep -l sync_mempools ./test/functional/*.py)
-END VERIFY SCRIPT-
2019-04-09 12:09:53 -04:00
MarcoFalke
faa7cdf764
scripted-diff: Update copyright in ./test
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./test/
-END VERIFY SCRIPT-
2019-03-02 10:58:35 -05:00
MarcoFalke
fa0e65b772
scripted-diff: test: Remove brackets after assert
-BEGIN VERIFY SCRIPT-
sed -i --regexp-extended -e 's/assert ?\((.+)\)(( )*)?(#.*)?$/assert \1\3\3\4/g' $(git grep -l --extended-regexp 'assert ?\(' test)
-END VERIFY SCRIPT-
2019-03-02 10:51:35 -05:00
MarcoFalke
fac9539836
qa: Run all tests even if wallet is not compiled 2018-09-10 17:53:21 -04:00
practicalswift
68400d8b96 tests: Use explicit imports 2018-08-13 14:13:39 +02:00
MarcoFalke
8ac7125d59
Merge #13916: qa: wait_for_verack by default
fa5587fe71 qa: wait_for_verack by default (MarcoFalke)

Pull request description:

  This removes the need to do so manually every time a connection is added.

Tree-SHA512: a46c92cb4df41e30778b42b9fd3dcbd8d2d82aa7503d1213cb1c1165034f648d8caee01c292e2d87d05b0f71696996eef5be8a753f35ab49e5f66b0e3bf29f21
2018-08-09 08:07:28 -04:00
MarcoFalke
fa5587fe71
qa: wait_for_verack by default 2018-08-08 17:22:35 -04:00
DrahtBot
eb7daf4d60 Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
MarcoFalke
fa87da2f17
qa: Avoid start/stop of the network thread mid-test 2018-06-25 14:06:41 -04:00
John Bampton
0d31ef4762 Enable W191 and W291 flake8 checks.
Remove trailing whitespace from Python files.
Convert tabs to spaces.
2018-05-11 07:59:05 +10:00
John Newbery
728667b771 scripted-diff: rename TestNode to TestP2PConn in tests
Several test scripts define a subclass of P2PInterface called TestNode.
This commit renames those to TestP2PConn since we already have a
TestNode class in the test framework.

-BEGIN VERIFY SCRIPT-
sed -i s/TestNode/TestP2PConn/ test/functional/*py test/functional/test_framework/comptool.py
_END VERIFY SCRIPT-
2018-03-19 14:58:00 -04:00
Anthony Towns
61b8f7f273 [tests] Rename p2p_* functional tests. 2018-01-25 09:44:29 +10:00
Renamed from test/functional/p2p-feefilter.py (Browse further)