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

Don't share objects between TestInstances #6465

merged 1 commit into from Jul 24, 2015

Conversation

casey
Copy link
Contributor

@casey 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
laanwj added a commit that referenced this issue 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 test-instance-objects-sharing-bug branch Sep 20, 2015
zkbot added a commit to zcash/zcash that referenced this issue Feb 15, 2017
zkbot added a commit to zcash/zcash that referenced this issue Feb 20, 2017
zkbot added a commit to zcash/zcash that referenced this issue 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.
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants