Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: randomize perturbed files excluding ldb #29182

Closed
wants to merge 1 commit into from

Conversation

L0laL33tz
Copy link
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

@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 4, 2024

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.

Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep your fixup commits squashed according to https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#squashing-commits

tf.seek(150)
tf.write(b"1" * 200)
else:
tf.seek(randint(150, 15000))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are block files guaranteed to contain this many bytes of blocks, always?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

                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

@kevkevinpal
Copy link
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?

@DrahtBot
Copy link
Contributor

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

@DrahtBot
Copy link
Contributor

DrahtBot commented Apr 9, 2024

⌛ 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.

@maflcko
Copy link
Member

maflcko commented Apr 9, 2024

Closing for now, but feel free to open a new pull request, with the changes rebased.

@maflcko maflcko closed this Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants