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

[Tests] Add mempool_limit.py test #7153

Merged
merged 2 commits into from Dec 22, 2015

Conversation

Projects
None yet
3 participants
@jonasschnelli
Member

jonasschnelli commented Dec 2, 2015

This will test mempools tx eviction (-maxmempool) together with the new conflict handling (#7105)

@jonasschnelli jonasschnelli added the Tests label Dec 2, 2015

Show outdated Hide outdated qa/rpc-tests/mempool_limit.py
return Decimal(amount).quantize(Decimal('0.00000001'), rounding=ROUND_DOWN)
def __init__(self):
# Some pre-processing to create a bunch of OP_RETURN txouts to insert into transactions we create

This comment has been minimized.

@MarcoFalke

MarcoFalke Dec 2, 2015

Member

If you copied this code, DRY?

@MarcoFalke

MarcoFalke Dec 2, 2015

Member

If you copied this code, DRY?

This comment has been minimized.

@jonasschnelli

jonasschnelli Dec 2, 2015

Member

Yes. I think this code part is in maxuploadtarget.py, prioritise_transaction.py and pruning.py. Someone should refactor that once. I have original taken this from a test that @sdaftuar wrote.

@jonasschnelli

jonasschnelli Dec 2, 2015

Member

Yes. I think this code part is in maxuploadtarget.py, prioritise_transaction.py and pruning.py. Someone should refactor that once. I have original taken this from a test that @sdaftuar wrote.

This comment has been minimized.

@MarcoFalke

MarcoFalke Dec 2, 2015

Member

Mind to do it in this PR like 826079e?

@MarcoFalke

MarcoFalke Dec 2, 2015

Member

Mind to do it in this PR like 826079e?

This comment has been minimized.

@MarcoFalke

MarcoFalke Dec 2, 2015

Member

It's enough to review this method once and not every time a pull tester PR is opened.

@MarcoFalke

MarcoFalke Dec 2, 2015

Member

It's enough to review this method once and not every time a pull tester PR is opened.

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli

jonasschnelli Dec 3, 2015

Member

Nits addresses: refactored the shared functions (moved to util.py).

Member

jonasschnelli commented Dec 3, 2015

Nits addresses: refactored the shared functions (moved to util.py).

class MempoolLimitTest(BitcoinTestFramework):
def __init__(self):

This comment has been minimized.

@MarcoFalke

MarcoFalke Dec 3, 2015

Member

Can you do the same here?

    def __init__(self):
        self.txouts = create_many_txouts()
@MarcoFalke

MarcoFalke Dec 3, 2015

Member

Can you do the same here?

    def __init__(self):
        self.txouts = create_many_txouts()

This comment has been minimized.

@jonasschnelli

jonasschnelli Dec 3, 2015

Member

This part needs to be refactored between 4 existing tests.
This PRs intent is not to refactor the test framework instead it should add a mempool limit/eviction test.

@jonasschnelli

jonasschnelli Dec 3, 2015

Member

This part needs to be refactored between 4 existing tests.
This PRs intent is not to refactor the test framework instead it should add a mempool limit/eviction test.

This comment has been minimized.

@MarcoFalke

MarcoFalke Dec 3, 2015

Member

Consider it a NIT but I don't like having the same code in 4 locations. You are guaranteed to get a bug out of that some day. (We already had it with other rpc tests)

@MarcoFalke

MarcoFalke Dec 3, 2015

Member

Consider it a NIT but I don't like having the same code in 4 locations. You are guaranteed to get a bug out of that some day. (We already had it with other rpc tests)

This comment has been minimized.

@laanwj

laanwj Dec 3, 2015

Member

Having the same code in 4 locations only makes sense if it is expected to diverge again later. Over-eager de-duplication can result in more complex code in such cases.

I don't think that's the case here. But I also agree with @jonasschnelli that refactoring is not required in a PR that adds a test.

@laanwj

laanwj Dec 3, 2015

Member

Having the same code in 4 locations only makes sense if it is expected to diverge again later. Over-eager de-duplication can result in more complex code in such cases.

I don't think that's the case here. But I also agree with @jonasschnelli that refactoring is not required in a PR that adds a test.

@MarcoFalke

View changes

Show outdated Hide outdated qa/rpc-tests/mempool_limit.py
def setup_network(self):
self.nodes = []
self.nodes.append(start_node(0, self.options.tmpdir, ["-maxmempool=5", "-spendzeroconfchange=0", "-debug"]))
self.nodes.append(start_node(1, self.options.tmpdir, []))

This comment has been minimized.

@MarcoFalke

MarcoFalke Dec 3, 2015

Member

Nit: Is it required to have two nodes?

@MarcoFalke

MarcoFalke Dec 3, 2015

Member

Nit: Is it required to have two nodes?

This comment has been minimized.

@jonasschnelli

jonasschnelli Dec 3, 2015

Member

Good point! Is was only required because we took an address from the 2nd node (but can also be an address from node[0]).
Thanks. Fixed and force pushed.

@jonasschnelli

jonasschnelli Dec 3, 2015

Member

Good point! Is was only required because we took an address from the 2nd node (but can also be an address from node[0]).
Thanks. Fixed and force pushed.

@MarcoFalke

This comment has been minimized.

Show comment
Hide comment
@MarcoFalke

MarcoFalke Dec 3, 2015

Member

utACK 7632cf6. Runs for 4 secs, so should be ok to run every time.

Member

MarcoFalke commented Dec 3, 2015

utACK 7632cf6. Runs for 4 secs, so should be ok to run every time.

@laanwj laanwj merged commit 7632cf6 into bitcoin:master Dec 22, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

laanwj added a commit that referenced this pull request Dec 22, 2015

Merge pull request #7153
7632cf6 [Tests] Refactor some shared functions (Jonas Schnelli)
110ff11 [Tests] Add mempool_limit.py test (Jonas Schnelli)
@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj
Member

laanwj commented Dec 22, 2015

jonasschnelli added a commit that referenced this pull request Dec 22, 2015

[Tests] Add mempool_limit.py test
- [Tests] Add mempool_limit.py test
- [Tests] Refactor some shared functions

Github-Pull: #7153
Rebased-From: 110ff11 7632cf6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment