Skip to content

Conversation

@jnewbery
Copy link
Contributor

fixes #12259 (and tidies up the test)

The problem was that the node was still in IBD at the point the last block was generated. UpdateTip() will not generate a warning if the node is still in IBD:

if (!IsInitialBlockDownload())

The 'proper' fix would be to remove the overenthusiastic latching in DoWarning:

static bool fWarned = false;

so that more than one warning message can be output to alertnotify. Really we should suppress multiple messages of the same type, but allow messages to be output if they're for different warnings. That would mean the test wouldn't need to stop-start the node.

Copy link
Member

Choose a reason for hiding this comment

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

Should say more than 50, not less than

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, fixed

Copy link
Member

Choose a reason for hiding this comment

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

nit: 60 seconds seems overkill, what about 5 or 10?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no harm in having it longer

Copy link
Member

Choose a reason for hiding this comment

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

I sometimes make tests fail on purpose, so having to wait a minute (or going into the test each time and having to modify it) is somewhat inconvenient.

Copy link
Member

Choose a reason for hiding this comment

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

Also, should the test fail for some reason, the earlier you know the better. As a rule of thumb, I estimate the time it would take to fulfill the predicate, double that for travis, then double again just to be safe.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You can change the timeout on your failure-triggering case 🙂

In my opinion it's better to have this too long than too short, to avoid spurious Travis failures.

Copy link
Member

Choose a reason for hiding this comment

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

I also prefer waiting on the long side, if it doesn't slow down the test in the passing case. Travis can be really slow when the servers are contended.

Copy link
Member

Choose a reason for hiding this comment

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

Generating that block will not help to get us out of ibd any sooner. Am I mistaken?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

generating a block guarantees that we'll get out of IBD. I've updated the comment.

@maflcko
Copy link
Member

maflcko commented Jan 24, 2018

Concept ACK

@jnewbery jnewbery force-pushed the fix_versionbits_warning_test branch from 9100159 to f36607e Compare January 24, 2018 21:16
@fanquake fanquake added the Tests label Jan 24, 2018
@laanwj
Copy link
Member

laanwj commented Jan 25, 2018

Seems to need rebase (already?).

@maflcko
Copy link
Member

maflcko commented Jan 25, 2018

utACK f36607eb8c Needs rebase

Makes following changes to fix and tidy up p2p-versionbits-warning.py:
- add node alias in the run() method
- call versionbits_in_alert_file() in a wait_until loop.
- don't clear out the alert.txt file
- explicitly comment why the node needs to be stop-started
- Verify that the node is out of IBD after stop-start (nodes in IBD do
not generate alert messages)
- no need to subclass P2PInterface
@jnewbery jnewbery force-pushed the fix_versionbits_warning_test branch from f36607e to 1e2e09e Compare January 25, 2018 13:01
@jnewbery
Copy link
Contributor Author

rebased (test file name change)

@maflcko maflcko merged commit 1e2e09e into bitcoin:master Jan 25, 2018
maflcko pushed a commit that referenced this pull request Jan 25, 2018
1e2e09e Fix intermittent failure in p2p-versionbits-warning.py (John Newbery)
3bbd843 Improve comments/logging in p2p-versionbits-warning.py (John Newbery)
ef2beb2 Fix flake8 warnings in p2p-versionbits-warning.py (John Newbery)

Pull request description:

  fixes #12259 (and tidies up the test)

  The problem was that the node was still in IBD at the point the last block was generated. UpdateTip() will not generate a warning if the node is still in IBD:

  https://github.com/bitcoin/bitcoin/blob/cc5870a4057f0322509dde5877fb08258bf4ec50/src/validation.cpp#L2151

  The 'proper' fix would be to remove the overenthusiastic latching in DoWarning:

  https://github.com/bitcoin/bitcoin/blob/cc5870a4057f0322509dde5877fb08258bf4ec50/src/validation.cpp#L2135

  so that more than one warning message can be output to `alertnotify`. Really we should suppress multiple messages of the same type, but allow messages to be output if they're for different warnings. That would mean the test wouldn't need to stop-start the node.

Tree-SHA512: 5c9aa5af7eba3c1350ea28482d57d3d79e3166c6224ceddb5d5a631090081d890d7403015e41f413c22990959a488cf1231f88bb825c54a609b24f89c450a1f6
@jnewbery jnewbery deleted the fix_versionbits_warning_test branch January 25, 2018 13:11
UdjinM6 pushed a commit to dashpay/dash that referenced this pull request Jan 2, 2020
* Wait a little bit longer in wallet-encryption.py

The timed wallet locking is happening by an asynchronous task internally,
which means that it might need a little bit longer then the specified
timeout.

* Add workaround for p2p-versionbits-warnings.py until we backport bitcoin#12264
UdjinM6 pushed a commit to UdjinM6/dash that referenced this pull request Jan 10, 2020
* Wait a little bit longer in wallet-encryption.py

The timed wallet locking is happening by an asynchronous task internally,
which means that it might need a little bit longer then the specified
timeout.

* Add workaround for p2p-versionbits-warnings.py until we backport bitcoin#12264
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 18, 2020
1e2e09e Fix intermittent failure in p2p-versionbits-warning.py (John Newbery)
3bbd843 Improve comments/logging in p2p-versionbits-warning.py (John Newbery)
ef2beb2 Fix flake8 warnings in p2p-versionbits-warning.py (John Newbery)

Pull request description:

  fixes bitcoin#12259 (and tidies up the test)

  The problem was that the node was still in IBD at the point the last block was generated. UpdateTip() will not generate a warning if the node is still in IBD:

  https://github.com/bitcoin/bitcoin/blob/cc5870a4057f0322509dde5877fb08258bf4ec50/src/validation.cpp#L2151

  The 'proper' fix would be to remove the overenthusiastic latching in DoWarning:

  https://github.com/bitcoin/bitcoin/blob/cc5870a4057f0322509dde5877fb08258bf4ec50/src/validation.cpp#L2135

  so that more than one warning message can be output to `alertnotify`. Really we should suppress multiple messages of the same type, but allow messages to be output if they're for different warnings. That would mean the test wouldn't need to stop-start the node.

Tree-SHA512: 5c9aa5af7eba3c1350ea28482d57d3d79e3166c6224ceddb5d5a631090081d890d7403015e41f413c22990959a488cf1231f88bb825c54a609b24f89c450a1f6
FornaxA pushed a commit to ioncoincore/ion that referenced this pull request Jul 6, 2020
* Wait a little bit longer in wallet-encryption.py

The timed wallet locking is happening by an asynchronous task internally,
which means that it might need a little bit longer then the specified
timeout.

* Add workaround for p2p-versionbits-warnings.py until we backport bitcoin#12264

Signed-off-by: cevap <[email protected]>
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
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.

[qa] p2p-versionbits-warning.py fails occasionally

4 participants