Skip to content

Commit

Permalink
Merge bitcoin#22907: test:Avoid intermittent test failure in feature_…
Browse files Browse the repository at this point in the history
…csv_activation.py

fa676db test: pep-8 whitespace (MarcoFalke)
faed284 test: Avoid intermittent test failure in feature_csv_activation.py (MarcoFalke)

Pull request description:

  Otherwise there will be disconnects if the test runs longer than the default peertimeout (60s):

  ```
   node0 2021-09-05T20:28:30.973116Z (mocktime: 2021-09-01T07:17:29Z) [net] [net.cpp:1323] [InactivityCheck] socket receive timeout: 393061s peer=0
  ```

  Fix that by skipping `InactivityCheck` via a large `-peertimeout`.

ACKs for top commit:
  fanquake:
    ACK fa676db

Tree-SHA512: 061c0585a805aa2f8e55c4beedd4b8498a2951f33d60aa3632dda0a284db3a627d14a23dbd57e8a66c69a1612f39418e3a755c8ca97f6ae1105c0d70f0d1a801
  • Loading branch information
merge-script authored and vijaydasmp committed Jul 26, 2024
1 parent 414db1b commit e352a43
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/functional/feature_csv_activation.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
SEQ_TYPE_FLAG = 1 << 22
SEQ_RANDOM_LOW_BIT = 1 << 18


def relative_locktime(sdf, srhb, stf, srlb):
"""Returns a locktime with certain bits set."""

Expand All @@ -79,6 +80,7 @@ def relative_locktime(sdf, srhb, stf, srlb):
locktime |= SEQ_RANDOM_LOW_BIT
return locktime


def all_rlt_txs(txs):
return [tx['tx'] for tx in txs]

Expand Down Expand Up @@ -150,6 +152,7 @@ def set_test_params(self):
# Must also set '-maxtipage=600100' to allow syncing from very old blocks
# and '-dip3params=2000:2000' to create pre-dip3 blocks only
self.extra_args = [[
'-peertimeout=999999', # bump because mocktime might cause a disconnect otherwise
'-whitelist=noban@127.0.0.1',
'-maxtipage=600100', '-dip3params=2000:2000',
'-par=1', # Use only one script thread to get the exact reject reason for testing
Expand Down Expand Up @@ -201,7 +204,7 @@ def run_test(self):
self.nodeaddress = self.nodes[0].getnewaddress()

# Activation height is hardcoded
test_blocks = self.generate_blocks(CSV_ACTIVATION_HEIGHT-5 - COINBASE_BLOCK_COUNT)
test_blocks = self.generate_blocks(CSV_ACTIVATION_HEIGHT - 5 - COINBASE_BLOCK_COUNT)
#test_blocks = self.generate_blocks(345)
self.send_blocks(test_blocks)
assert not softfork_active(self.nodes[0], 'csv')
Expand Down Expand Up @@ -481,5 +484,6 @@ def run_test(self):
self.send_blocks([self.create_test_block(time_txs)])
self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash())


if __name__ == '__main__':
BIP68_112_113Test().main()

0 comments on commit e352a43

Please sign in to comment.