Skip to content

Backport bitcoin#15773: test: Add BitcoinTestFramework::sync_* methods (incomplete backport)#3409

Merged
UdjinM6 merged 6 commits into
dashpay:developfrom
codablock:pr_backport_15773
Apr 14, 2020
Merged

Backport bitcoin#15773: test: Add BitcoinTestFramework::sync_* methods (incomplete backport)#3409
UdjinM6 merged 6 commits into
dashpay:developfrom
codablock:pr_backport_15773

Conversation

@codablock

@codablock codablock commented Apr 12, 2020

Copy link
Copy Markdown

This backports bitcoin#15773 and also moves the bump_mocktime call into the new TestFramework.sync_mempool method, instead of doing this for every sync_mempool call. This is needed as it turned out that much more places need this logic as otherwise tests fail randomly.

Backport is done commit by commit and scripted diffs are not really backported but instead re-applied to ensure we don't miss any Dash specific places.

I left out fafe5f0, as it had too many conflicts. Better to do this later by redoing the lint checks and following the suggestions.

codablock and others added 2 commits April 12, 2020 07:51
…ions and confusion

-BEGIN VERIFY SCRIPT-
FILE_LIST=$(git grep -l 'def sync_blocks' ./test/functional/*.py)
sed -i -e 's/def sync_blocks/def send_blocks/g'   $FILE_LIST
sed -i -e 's/self.sync_blocks/self.send_blocks/g' $FILE_LIST
-END VERIFY SCRIPT-
@codablock codablock added this to the 16 milestone Apr 12, 2020
@codablock codablock force-pushed the pr_backport_15773 branch 2 times, most recently from f6748af to 7f53935 Compare April 12, 2020 11:12

@PastaPastaPasta PastaPastaPasta left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good overall, two comments and are you forgetting bitcoin@fafe5f0?

Comment thread test/functional/test_framework/test_framework.py Outdated
Comment thread test/functional/test_framework/test_framework.py Outdated
MarcoFalke and others added 4 commits April 12, 2020 23:59
Instead of doing it in every place it's needed
-BEGIN VERIFY SCRIPT-
sed -i -e 's/sync_blocks(self.nodes)/self.sync_blocks()/g'     $(git grep -l 'sync_blocks(self.nodes)'   ./test/functional/*.py)
sed -i -e 's/sync_mempools(self.nodes)/self.sync_mempools()/g' $(git grep -l 'sync_mempools(self.nodes)' ./test/functional/*.py)

sed -i -e 's/  sync_blocks(/  self.sync_blocks(/g'     $(git grep -l sync_blocks   ./test/functional/*.py)
sed -i -e 's/  sync_mempools(/  self.sync_mempools(/g' $(git grep -l sync_mempools ./test/functional/*.py)
-END VERIFY SCRIPT-
@codablock

Copy link
Copy Markdown
Author

@Pasta regarding missing bitcoin@fafe5f0, please see the PR description (I added the info about fafe5f0 a few minutes after creating the PR)

@codablock

Copy link
Copy Markdown
Author

fyi, tests will verify likely not get green with this PR as a lot of other failures are fixed with #3410

@PastaPastaPasta

Copy link
Copy Markdown
Member

@Pasta regarding missing bitcoin@fafe5f0, please see the PR description (I added the info about fafe5f0 a few minutes after creating the PR)

Whoops! I guess it is a good thing to read the whole PR description! In that case can we update the PR title to say "partial"?

@PastaPastaPasta PastaPastaPasta left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

utACK

@codablock codablock changed the title Backport bitcoin#15773: test: Add BitcoinTestFramework::sync_* methods Backport bitcoin#15773: test: Add BitcoinTestFramework::sync_* methods (incomplete backport) Apr 12, 2020
@codablock

Copy link
Copy Markdown
Author

@PastaPastaPasta I added (incomplete backport) to the PR description

@codablock

Copy link
Copy Markdown
Author

Tests in #3410 just got green, so it should be safe to merge this PR and then proceed with merging #3410

@UdjinM6 UdjinM6 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

utACK

@UdjinM6 UdjinM6 merged commit 54198ce into dashpay:develop Apr 14, 2020
gades pushed a commit to cosanta/cosanta-core that referenced this pull request Feb 22, 2022
…s (incomplete backport) (dashpay#3409)

* scripted-diff: Rename sync_blocks to send_blocks to avoid name collisions and confusion

-BEGIN VERIFY SCRIPT-
FILE_LIST=$(git grep -l 'def sync_blocks' ./test/functional/*.py)
sed -i -e 's/def sync_blocks/def send_blocks/g'   $FILE_LIST
sed -i -e 's/self.sync_blocks/self.send_blocks/g' $FILE_LIST
-END VERIFY SCRIPT-

* test: Pass at most one node group to sync_all

* test: Add BitcoinTestFramework::sync_* methods

* Move bumping of mocktime into BitcoinTestFramework.sync_mempool

Instead of doing it in every place it's needed

* scripted-diff: use self.sync_* methods

-BEGIN VERIFY SCRIPT-
sed -i -e 's/sync_blocks(self.nodes)/self.sync_blocks()/g'     $(git grep -l 'sync_blocks(self.nodes)'   ./test/functional/*.py)
sed -i -e 's/sync_mempools(self.nodes)/self.sync_mempools()/g' $(git grep -l 'sync_mempools(self.nodes)' ./test/functional/*.py)

sed -i -e 's/  sync_blocks(/  self.sync_blocks(/g'     $(git grep -l sync_blocks   ./test/functional/*.py)
sed -i -e 's/  sync_mempools(/  self.sync_mempools(/g' $(git grep -l sync_mempools ./test/functional/*.py)
-END VERIFY SCRIPT-

* Pass nodes into bump_mocktime

Co-authored-by: MarcoFalke <falke.marco@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants