Page MenuHomePhabricator

[backport#19177] test: Fix and clean p2p_invalid_messages functional tests
ClosedPublic

Authored by majcosta on May 13 2021, 01:16.

Details

Summary

af2a145e575f23c64909e6cf1fb323c603bda7ca Refactor resource exhaustion test (Troy Giorshev)
5c4648d17ba18e4194959963994cc6b37053f127 Fix "invalid message size" test (Troy Giorshev)
ff1e7b884447a5ba10553b2d964625f94e255bdc Move size limits to module-global (Troy Giorshev)
57890abf2c7919eddfec36178b1136cd44ffe883 Remove two unneeded tests (Troy Giorshev)

Pull request description:

This PR touches only the p2p_invalid_messages.py functional test module.  There are two main goals accomplished here.  First, it fixes the "invalid message size" test, which previously made a message that was invalid for multiple reasons.  Second, it refactors the file into a single consistent style.  This file appears to have originally had two authors, with different styles and some test duplication.

It should now be easier and quicker to understand this module, anticipating the upcoming [BIP324](https://github.com/bitcoin/bitcoin/pull/18242) and [AltNet](https://github.com/bitcoin/bitcoin/issues/18989) changes.

This should probably go in ahead of #19107, but the two are not strictly related.

Depends on D9511

Backport of core#19177

Test Plan
ninja all && ./test/functional/test_runner.py p2p_invalid_messages

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested changes to this revision.May 13 2021, 07:37
PiRK added a subscriber: PiRK.
PiRK added inline comments.
test/functional/p2p_invalid_messages.py
289 ↗(On Diff #28456)

This string seems to have been truncated ("junk messages").

This revision now requires changes to proceed.May 13 2021, 07:37

fixed debug log output string

This revision is now accepted and ready to land.May 13 2021, 12:06