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

Don't share objects between TestInstances #6465

Merged
merged 1 commit into from Jul 24, 2015
Merged

Conversation

@casey
Copy link
Contributor

casey commented Jul 22, 2015

If two TestInstances are created without providing a list of objects, they'll be shared across both instances.

@laanwj
Copy link
Member

laanwj commented Jul 24, 2015

Good catch. ACK.
(luckily this case doesn't ever trigger as only one test instance is created per test, but still)

@laanwj laanwj added the Tests label Jul 24, 2015
@laanwj laanwj merged commit 56b28fc into bitcoin:master Jul 24, 2015
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
laanwj added a commit that referenced this pull request Jul 24, 2015
56b28fc Don't share objects between TestInstances (Casey Rodarmor)
@luke-jr
Copy link
Member

luke-jr commented Sep 20, 2015

Nit: This doesn't actually fix the problem if objects is passed as a parameter. It would be better as:

self.blocks_and_transactions = list(objects)

...or maybe a deep-copy.

But maybe callers would want shared objects in some cases?

Without a real use case, it's hard to know what behaviour is sane here.

@casey casey deleted the casey:test-instance-objects-sharing-bug branch Sep 20, 2015
zkbot added a commit to zcash/zcash that referenced this pull request Feb 15, 2017
zkbot added a commit to zcash/zcash that referenced this pull request Feb 20, 2017
zkbot added a commit to zcash/zcash that referenced this pull request Mar 3, 2017
Bitcoin 0.12 test PRs 1

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6337
- bitcoin/bitcoin#6390
- bitcoin/bitcoin#5515
- bitcoin/bitcoin#6287 (partial, remainder included in bitcoin/bitcoin#6703)
- bitcoin/bitcoin#6465

Part of #2074.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.