Skip to content

test: make assumeUTXO test capture the expected fatal error - #28050

Merged
fanquake merged 1 commit into
bitcoin:masterfrom
furszy:2023_test_capture_assumeUTXO_fatal_error
Jul 10, 2023
Merged

test: make assumeUTXO test capture the expected fatal error#28050
fanquake merged 1 commit into
bitcoin:masterfrom
furszy:2023_test_capture_assumeUTXO_fatal_error

Conversation

@furszy

@furszy furszy commented Jul 7, 2023

Copy link
Copy Markdown
Member

The test is exercising the error, so it can capture it before the
test framework displays it on the console as an unforeseen
fatal error.

It is odd to observe a fatal error after executing the complete
test suite and seeing it pass successfully.

Reproduction Steps:
Run the unit test suite. A long AssumeUTXO fatal error will be
printed even when all tests pass successfully.

@DrahtBot

DrahtBot commented Jul 7, 2023

Copy link
Copy Markdown
Contributor

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

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK theStack, MarcoFalke, TheCharlatan

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 Jul 7, 2023
Comment thread src/test/validation_chainstatemanager_tests.cpp Outdated
The test is exercising the error, so it can capture it before
the test framework displays it on the console as an unforeseen
fatal error.
@furszy
furszy force-pushed the 2023_test_capture_assumeUTXO_fatal_error branch from 56a1ecb to 3e8bf2e Compare July 8, 2023 14:46

@furszy furszy left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated per feedback, thanks @MarcoFalke.

  • Moved DebugLogHelper usage to ASSERT_DEBUG_LOG.
  • Added reproduction steps to the PR description.

@theStack theStack left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested ACK 3e8bf2e

@maflcko

maflcko commented Jul 10, 2023

Copy link
Copy Markdown
Member

Also it may be good to name the commit that introduced the bug. Otherwise it will be harder for reviewers to see if there was a bug in that commit or if the change was intentional. Also, reviewers will be missing context.

@furszy

furszy commented Jul 10, 2023

Copy link
Copy Markdown
Member Author

Also it may be good to name the commit that introduced the bug. Otherwise it will be harder for reviewers to see if there was a bug in that commit or if the change was intentional. Also, reviewers will be missing context.

Ok. It was introduced with the test 87a1108.
Still, this isn't as serious as you imagine. It is just an extra print. 100% sure that wasn't intended.

The test is exercising a specific fatal error (checking that is being triggered), and doing so it makes the node call AbortNode. Which calls InitError which is connected to the noui signals interface, which is listened by the test framework base class, which prints the error to the console.

@maflcko

maflcko commented Jul 10, 2023

Copy link
Copy Markdown
Member

Are you sure, because locally I don't see it in 25.0:

$ ./bitcoin-25.0/bin/test_bitcoin  -t validation_chainstatemanager_tests/chainstatemanager_snapshot_completion_hash_mismatch 
Running 1 test case...

*** No errors detected

@furszy

furszy commented Jul 10, 2023

Copy link
Copy Markdown
Member Author

Are you sure, because locally I don't see it in 25.0:

$ ./bitcoin-25.0/bin/test_bitcoin  -t validation_chainstatemanager_tests/chainstatemanager_snapshot_completion_hash_mismatch 
Running 1 test case...

*** No errors detected

Ok good, found the commit. 6eb33bd introduced it. It removed the mock_shutdown function from the test (which was the one swalling the error).

@furszy

furszy commented Jul 10, 2023

Copy link
Copy Markdown
Member Author

cc @TheCharlatan then. Thanks @MarcoFalke.

@maflcko

maflcko commented Jul 10, 2023

Copy link
Copy Markdown
Member

lgtm ACK 3e8bf2e

@sedited sedited left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ACK 3e8bf2e

Thank you for fixing this.

@fanquake
fanquake merged commit c464e67 into bitcoin:master Jul 10, 2023
@furszy
furszy deleted the 2023_test_capture_assumeUTXO_fatal_error branch July 20, 2023 23:00
@bitcoin bitcoin locked and limited conversation to collaborators Jul 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants