test: randomize perturbed files excluding ldb #29182

pull L0laL33tz wants to merge 1 commits into bitcoin:master from L0laL33tz:fix_feature_init changing 1 files +10 −4
  1. L0laL33tz commented at 5:44 pm on January 4, 2024: contributor
    As discussed in #28831 the ldb files are too small to be randomized for pertubation. This PR excludes ldb files from randomization. Blockfiles are randomly perturbed, ldb file pertubation remains deterministic. For additional rationale see #28612
  2. DrahtBot commented at 5:44 pm on January 4, 2024: contributor

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

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #29034 (test: detect OS in functional tests consistently using platform.system() by theStack)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  3. DrahtBot added the label Tests on Jan 4, 2024
  4. DrahtBot added the label CI failed on Jan 4, 2024
  5. test: randomize perturbed files excluding ldb 965c8cdde7
  6. in test/functional/feature_init.py:146 in 3354e077b9 outdated
    145+                    # are too small in size for randomization.
    146+                    if str(target_file).endswith(".ldb"):
    147+                        tf.seek(150)
    148+                        tf.write(b"1" * 200)
    149+                    else:
    150+                        tf.seek(randint(150, 15000))
    


    maflcko commented at 12:06 pm on January 5, 2024:
    are block files guaranteed to contain this many bytes of blocks, always?

    L0laL33tz commented at 7:37 pm on January 6, 2024:

    I tested this the same way @fjahr tested the size of the ldb files in #28831 with

    0                self.log.info(f"Perturbing file to ensure failure {target_file}, size: {os.path.getsize(target_file)}")
    

    The tested blockfile should always have 16777216 bytes

  7. maflcko commented at 12:07 pm on January 5, 2024: member
    Please keep your fixup commits squashed according to https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#squashing-commits
  8. L0laL33tz force-pushed on Jan 5, 2024
  9. DrahtBot removed the label CI failed on Jan 5, 2024
  10. kevkevinpal commented at 4:14 pm on January 6, 2024: contributor

    I tested this by creating a loop similar to how @maflcko found an issue in #28831

    I also noticed that in this test we only perturbed one blk?????.dat file which is blk00000.dat Should we add another .dat file to test this on?

  11. DrahtBot added the label Needs rebase on Jan 11, 2024
  12. DrahtBot commented at 6:10 pm on January 11, 2024: contributor

    🐙 This pull request conflicts with the target branch and needs rebase.

  13. DrahtBot commented at 0:58 am on April 9, 2024: contributor

    ⌛ There hasn’t been much activity lately and the patch still needs rebase. What is the status here?

    • Is it still relevant? ➡️ Please solve the conflicts to make it ready for review and to ensure the CI passes.
    • Is it no longer relevant? ➡️ Please close.
    • Did the author lose interest or time to work on this? ➡️ Please close it and mark it ‘Up for grabs’ with the label, so that it can be picked up in the future.
  14. maflcko commented at 5:33 am on April 9, 2024: member
    Closing for now, but feel free to open a new pull request, with the changes rebased.
  15. maflcko closed this on Apr 9, 2024


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: 2024-06-29 10:13 UTC

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