Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Fix intermittent issue in interface_rest.py #29467

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Feb 22, 2024

Fixes:

 test  2024-02-22T16:15:37.465000Z TestFramework (ERROR): Assertion failed 
  Traceback (most recent call last):
  File "/ci_container_base/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 131, in main
   self.run_test()
  File "/ci_container_base/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/interface_rest.py", line 340, in run_test
   assert_equal(json_obj, mempool_info)
  File "/ci_container_base/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/util.py", line 57, in assert_equal
   raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
 AssertionError: not({'loaded': True, 'size': 3, 'bytes': 312, 'usage': 3600, 'total_fee': Decimal('0.00093600'), 'maxmempool': 300000000, 'mempoolminfee': Decimal('0.00001000'), 'minrelaytxfee': Decimal('0.00001000'), 'incrementalrelayfee': Decimal('0.00001000'), 'unbroadcastcount': 1, 'fullrbf': False} == {'loaded': True, 'size': 3, 'bytes': 312, 'usage': 3600, 'total_fee': Decimal('0.00093600'), 'maxmempool': 300000000, 'mempoolminfee': Decimal('0.00001000'), 'minrelaytxfee': Decimal('0.00001000'), 'incrementalrelayfee': Decimal('0.00001000'), 'unbroadcastcount': 0, 'fullrbf': False})

https://cirrus-ci.com/task/4852944378527744?logs=ci#L4436

@DrahtBot
Copy link
Contributor

DrahtBot commented Feb 22, 2024

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

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK mzumsande, m3dwards

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 Feb 22, 2024
Copy link
Contributor

@mzumsande mzumsande left a comment

Choose a reason for hiding this comment

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

ACK faeed91

The problem seems to be that the existing sync_all waits until the mempool sizes are identical, but the call to RemoveUnbroadcastTx() is executed right after sending the tx in ProcessGetData(), so nothing waits for that.
An alternative fix might be to switch the order in ProcessGetData() (call RemoveUnbroadcastTx() right before MakeAndPushMessage() instead of right after).

@maflcko maflcko added this to the 27.0 milestone Feb 23, 2024
@m3dwards
Copy link
Contributor

ACK faeed91

Tested on ARM Mac.

I personally haven't seen that flake yet but @mzumsande's explanation for why it can happen makes sense to me and this seems like a pragmatic solution to the test failing.

@fanquake fanquake merged commit 60b6ff5 into bitcoin:master Feb 26, 2024
16 checks passed
@maflcko maflcko deleted the 2402-fix-test- branch February 26, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants