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: use sleepy wait-for-log in reindex readonly #30006

Merged
merged 1 commit into from May 9, 2024

Conversation

pinheadmz
Copy link
Member

Also rename the busy wait-for-log method to prevent recurrence. See #27039 (comment)

@DrahtBot
Copy link
Contributor

DrahtBot commented Apr 30, 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.

Type Reviewers
ACK maflcko, tdb3, rkrux, achow101

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #28121 (include verbose "debug-message" field in testmempoolaccept response by pinheadmz)

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.

@DrahtBot DrahtBot added the Tests label Apr 30, 2024
@@ -75,7 +75,7 @@ def reindex_readonly(self):

if undo_immutable:
self.log.debug("Attempt to restart and reindex the node with the unwritable block file")
with self.nodes[0].wait_for_debug_log([b"Reindexing finished"]):
with self.nodes[0].assert_debug_log(["Reindexing finished"]):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
with self.nodes[0].assert_debug_log(["Reindexing finished"]):
with self.nodes[0].assert_debug_log(["Reindexing finished"], timeout=30):

I think the timeout needs to be preserved?

Copy link
Member Author

Choose a reason for hiding this comment

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

Gotcha, the default timeout in wait_for_debug_log() now busy_wait_for_debug_log() is 60 unless im mistaken?

Copy link
Member

Choose a reason for hiding this comment

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

Sure, any value works. But 2 seconds may be a bit on the risky side.

Copy link
Member Author

Choose a reason for hiding this comment

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

done, thanks

@maflcko
Copy link
Member

maflcko commented Apr 30, 2024

Thanks. lgtm ACK 453c871, after fixed-up timeout value.

Also rename the busy wait-for-log method to prevent recurrence
@maflcko
Copy link
Member

maflcko commented Apr 30, 2024

utACK fd6a7d3

Copy link
Contributor

@tdb3 tdb3 left a comment

Choose a reason for hiding this comment

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

ACK for fd6a7d3

Thank you. This should make test execution slightly more efficient and every little bit helps with many tests running in parallel (with test_runner).

Built and ran all functional tests (all passed). Reviewed code changes, but didn't notice anything besides what is already covered in @maflcko's comments.

Copy link

@rkrux rkrux left a comment

Choose a reason for hiding this comment

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

ACK fd6a7d3

Make and tests successful.
I found this answer helpful that explains how yield and with interact with each other: https://stackoverflow.com/a/35489897/12218815

@achow101
Copy link
Member

achow101 commented May 9, 2024

ACK fd6a7d3

@achow101 achow101 merged commit 98dd4e7 into bitcoin:master May 9, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants