Skip to content

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Aug 30, 2024

Similar to #30705:

The goal of this test case is to check that the sync works at all, not to check any timeout.

On extremely slow hardware (for example qemu virtual hardware), downloading the 4110 BLOCKS_TO_MINE may take longer than the block download timeout.

Fix it by pinning the time using mocktime temporarily, and advance it immediately after the sync.

@DrahtBot
Copy link
Contributor

DrahtBot commented Aug 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
Concept ACK tdb3

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

@DrahtBot DrahtBot added the Tests label Aug 30, 2024
@maflcko
Copy link
Member Author

maflcko commented Aug 30, 2024

Example: https://drahtbot.space/temp_scratch/p2p_headers_sync_with_minchainwork_257.tar.zstd , which contains a [msghand] [net_processing.cpp:6260] [SendMessages] Timeout downloading block 275fa5456f30065b7a557e56c1232e6754f98eec1fbb65b6a539e15cd3134945 from peer=1, disconnecting.

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.

Concept ACK
Left a question/suggestion.

Comment on lines +53 to +56
def mocktime_all(self, time):
for n in self.nodes:
n.setmocktime(time)

Copy link
Contributor

Choose a reason for hiding this comment

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

Setting mock time for all nodes seems like it could potentially be useful in multiple functional tests. Maybe it could be added to BitcoinTestFramework rather than live in this functional test?

Copy link
Member Author

@maflcko maflcko Sep 2, 2024

Choose a reason for hiding this comment

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

Possibly. I guess, if another test needs it, it should be trivial to move?

Edit: To extend on that,

  • I is unclear whether another test will need this, so moving to the framework seems too early.
  • The framework already has methods on the test node to deal with mocktime, so adding more will increase the complexity and bloat even more.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's reasonable. I don't feel super strongly about it.

Copy link
Contributor

@stratospher stratospher left a comment

Choose a reason for hiding this comment

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

ACK fa247e6. Checked the timeout downloading block logs before/after using setmocktime.

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 fa247e6

@fanquake fanquake merged commit a74bdee into bitcoin:master Sep 2, 2024
16 checks passed
@maflcko maflcko deleted the 2408-test-p2p branch September 2, 2024 14:15
Copy link
Contributor

@marcofleon marcofleon left a comment

Choose a reason for hiding this comment

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

Code review ACK fa247e6. Post merge

@fanquake fanquake mentioned this pull request Sep 3, 2024
fanquake pushed a commit to fanquake/bitcoin that referenced this pull request Sep 3, 2024
achow101 added a commit that referenced this pull request Sep 5, 2024
b2a1379 depends: build libevent with -D_GNU_SOURCE (fanquake)
199bb09 test: fixing failing system_tests/run_command under some Locales (Jadi)
342baab test: Avoid intermittent timeout in p2p_headers_sync_with_minchainwork.py (MarcoFalke)
5577d5a test: fix `TestShell` initialization (late follow-up for #30463) (Sebastian Falbesoner)

Pull request description:

  Backports:
  * #30714
  * #30743
  * #30761
  * #30788

ACKs for top commit:
  willcl-ark:
    ACK b2a1379
  achow101:
    ACK b2a1379
  stickies-v:
    ACK b2a1379

Tree-SHA512: bf08ac0c613395def974a1b287345d4a64edc066c14f8c9f0184478b0e33e48333760eeb6e96b6b5fbafbb21b40d01875e3f526213a2734e226b2e111d71f3a3
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.

6 participants