Accept unordered tracepoints in interface_usdt_utxocache.py #32101

pull willcl-ark wants to merge 1 commits into bitcoin:master from willcl-ark:usdt-order-independent changing 1 files +22 −11
  1. willcl-ark commented at 12:48 PM on March 20, 2025: member

    We have encountered an instance where the tracepoints were not collected in the same order they were fired (#31951).

    Tracepoint ordering is not guaranteed in userspace for a number of reasons.

    As this test does not require a strict collection/processing order collect expected and actual events into dicts and compare them.

    This will gracefully handle both the number of events, and out-of-order events should they reoccur in the future.

    Fixes: #31951

  2. DrahtBot commented at 12:48 PM on March 20, 2025: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32101.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK laanwj, 0xB10C

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  3. fanquake requested review from 0xB10C on Mar 21, 2025
  4. 0xB10C commented at 3:54 PM on March 24, 2025: contributor

    ACK 693d1e2f54baa0d5e407153f79b2f98385e6b8d9

    I successfully ran the changed test a couple of times and the code changes look good to me.

    That this behavior works as intended can be tested with this patch:

    diff --git a/test/functional/interface_usdt_utxocache.py b/test/functional/interface_usdt_utxocache.py
    index d4213d5020..94ec23c51a 100755
    --- a/test/functional/interface_usdt_utxocache.py
    +++ b/test/functional/interface_usdt_utxocache.py
    @@ -326,6 +326,7 @@ class UTXOCacheTracepointTest(BitcoinTestFramework):
                     event.is_coinbase
                 )
    
    +        expected_utxocache_adds.reverse()
             expected_add_keys = {(e["txid"], e["index"], e["height"], e["value"], e["is_coinbase"])
                                  for e in expected_utxocache_adds}
             expected_spent_keys = {(e["txid"], e["index"], e["height"], e["value"], e["is_coinbase"])
    
  5. laanwj added the label Tests on Mar 26, 2025
  6. in test/functional/interface_usdt_utxocache.py:319 in 693d1e2f54 outdated
     315 | @@ -324,9 +316,26 @@ def handle_utxocache_spent(_, data, __):
     316 |  
     317 |          self.log.info(
     318 |              f"check that we successfully traced {EXPECTED_HANDLE_ADD_SUCCESS} adds and {EXPECTED_HANDLE_SPENT_SUCCESS} spent")
     319 | -        for expected_utxo, actual_event in zip(expected_utxocache_adds + expected_utxocache_spents,
     320 | -                                               actual_utxocache_adds + actual_utxocache_spents):
     321 | -            compare_utxo_with_event(expected_utxo, actual_event)
     322 | +
    


    laanwj commented at 1:42 PM on March 26, 2025:

    Maybe add a comment about the events possible arriving out of order (to make it clear why this is done without the context of this PR).


    willcl-ark commented at 2:15 PM on March 26, 2025:

    Good idea. Added a comment in 248fdd88dcf651a0560a3eedfb8af61f38c61400

    git range-diff 693d1e2f54baa0d5e407153f79b2f98385e6b8d9...248fdd88dcf651a0560a3eedfb8af61f38c61400


    laanwj commented at 2:37 PM on March 26, 2025:

    Thanks!

  7. willcl-ark force-pushed on Mar 26, 2025
  8. test: accept unordered tracepoints in...
    ...interface_usdt_utxocache.py
    
    We have encountered an instance where the tracepoints were not collected
    in the same order they were fired (#31951).
    
    Tracepoint ordering is not guaranteed in userspace for a number of
    reasons.
    
    As this test does not require a strict collection/processing order
    collect `expected` and `actual` events into dicts and compare them.
    
    This will gracefully handle both the number of events, and out-of-order
    events should they reoccur in the future.
    248fdd88dc
  9. willcl-ark force-pushed on Mar 26, 2025
  10. laanwj approved
  11. laanwj commented at 2:38 PM on March 26, 2025: member

    Code review ACK 248fdd88dcf651a0560a3eedfb8af61f38c61400

  12. 0xB10C commented at 5:23 PM on March 26, 2025: contributor

    re-ACK 248fdd88dcf651a0560a3eedfb8af61f38c61400

  13. fanquake merged this on Mar 27, 2025
  14. fanquake closed this on Mar 27, 2025

  15. sedited referenced this in commit a9c46ce3c3 on Apr 24, 2025
  16. stickies-v referenced this in commit 772a33e052 on May 23, 2025
  17. yuvicc referenced this in commit 069643f094 on Jul 6, 2025
  18. bug-castercv502 referenced this in commit 5b0af4b944 on Sep 28, 2025
  19. Kino1994 referenced this in commit 756eed3da5 on Jun 28, 2026
  20. BigcoinBGC referenced this in commit 79b7a88161 on Jun 30, 2026
  21. bitcoin locked this on Jul 30, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-08-06 18:52 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me