Page MenuHomePhabricator

Add new test cases to abc-finalize-.py
ClosedPublic

Authored by Fabien on Nov 30 2018, 17:41.

Details

Summary

Add new test cases and assertions.
Also replace the sync_blocks calls with a proper wait_for_tip() function.

Depends on D2161

Test Plan
./test/functional/test_runner.py abc-finalize-block

Diff Detail

Repository
rABC Bitcoin ABC
Branch
add_finalization_test_cases
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 4273
Build 6611: Bitcoin ABC Buildbot (legacy)
Build 6610: arc lint + arc unit

Event Timeline

Remove assertions against block height and rebase

Fabien added a child revision: Restricted Differential Revision.Nov 30 2018, 22:16
deadalnix requested changes to this revision.Dec 2 2018, 22:31

This ends up changing all the tests for no good reasons. Just add the new tests cases after the existing ones. You can use reconsiderblock/invalidate block to recreate the situation you desire.

test/functional/abc-finalize-block.py
154 ↗(On Diff #6233)

It's clearly not doing this anymore.

171 ↗(On Diff #6233)
alt_node.generate(10)

And then wait for node to catch up. You want to check that the node sync the way you expect note force the test framework to do it.

This revision now requires changes to proceed.Dec 2 2018, 22:31
deadalnix requested changes to this revision.Dec 6 2018, 18:06
deadalnix added inline comments.
test/functional/abc-finalize-block.py
152 ↗(On Diff #6280)

likestamp

171 ↗(On Diff #6280)

210 is finalized, so why change the comment ?

179 ↗(On Diff #6280)

This test really isn't testing anything useful. I don't see in what situation you'd end finalizing that block anyways. Plus we already checked that the finalized block is the tip.

180 ↗(On Diff #6280)

Plus you actually check the value here.

This revision now requires changes to proceed.Dec 6 2018, 18:06
Fabien marked an inline comment as done.Dec 6 2018, 19:37
Fabien added inline comments.
test/functional/abc-finalize-block.py
171 ↗(On Diff #6280)

Good catch, looks like a merge error while rebasing.

deadalnix added inline comments.
test/functional/abc-finalize-block.py
228

Maybe using alt_node_new_tip here would be best.

This revision is now accepted and ready to land.Dec 6 2018, 20:02
This revision was automatically updated to reflect the committed changes.