aboutsummaryrefslogtreecommitdiff
path: root/ci/test/00_setup_env_native_tidy.sh
diff options
context:
space:
mode:
author0xb10c <0xb10c@gmail.com>2022-07-01 13:17:30 +0200
committer0xb10c <0xb10c@gmail.com>2022-07-02 14:37:32 +0200
commitdba6f8234217565957e37516a0ea655f1180d99c (patch)
tree80eaf29234e96c5ff3dedc7a1d674bc4f3f90ec2 /ci/test/00_setup_env_native_tidy.sh
parent220a5a2841172a07d6d7849596316f0e0933e272 (diff)
downloadbitcoin-dba6f8234217565957e37516a0ea655f1180d99c.tar.xz
test: adopt USDT utxocache interface tests
The USDT interface exposes process internals via the tracepoints. This means, the USDT interface tests somewhat awardly depend on these internals. If internals change, the tests have to adopt to that change. Previously, the USDT interface tests weren't run in the CI so changes could break the USDT interface tests without being noticed (e.g. https://github.com/bitcoin/bitcoin/pull/25486). In fa13375aa3fcb4fd5b9e0d4c69ac31cf66c3209a a 'self.rescan_utxos()' call was added in the 'generate()' function of the test framework. 'rescan_utxos()' causes the UTXO cache to be flushed. In the USDT interface tests for the 'utxocache:flush' trancepoint, 'generate()' is used. As the utxo cache is now flushed more often, the number of flushes the tests expectes need to be adopted. Also, the utxo cache has now a different size when being flushed. The utxocache tracepoint is tested by shutting the node down and pruning blocks, to test the 'for_prune' argument. Changes: - A list 'expected_flushes' is now used which contains 'mode', 'for_prune', and 'size' for each expected flush. - When a flush happens, the expected-flush is removed from the list. This list is checked to be empty (unchanged). - Previously, shutting down caused these two flushes: UTXOCacheFlush(duration=*, mode=ALWAYS, size=104, memory=*, for_prune=False) UTXOCacheFlush(duration=*, mode=ALWAYS, size=0, memory=*, for_prune=False) now it causes these flushes: UTXOCacheFlush(duration=*, mode=ALWAYS, size=2, memory=*, for_prune=False) UTXOCacheFlush(duration=*, mode=ALWAYS, size=0, memory=*, for_prune=False) The 104 UTXOs flushed previously were mainly coinbase UTXOs generated in previous tests and the test setup. These are now already flushed. - In the 'for_prune' test we previously hooked into the tracepoint before mining blocks. This changed to only get notified about the tracepoint being triggered for the prune. Here, the utxo cache is empty already as it has just been flushed in 'generate()'. old: UTXOCacheFlush(duration=*, mode=NONE, size=350, memory=*, for_prune=True) new: UTXOCacheFlush(duration=*, mode=NONE, size=0, memory=*, for_prune=True)
Diffstat (limited to 'ci/test/00_setup_env_native_tidy.sh')
0 files changed, 0 insertions, 0 deletions