Skip to content

Don't share objects between TestInstances#6465

Merged
laanwj merged 1 commit into
bitcoin:masterfrom
casey:test-instance-objects-sharing-bug
Jul 24, 2015
Merged

Don't share objects between TestInstances#6465
laanwj merged 1 commit into
bitcoin:masterfrom
casey:test-instance-objects-sharing-bug

Conversation

@casey

@casey casey commented Jul 22, 2015

Copy link
Copy Markdown
Contributor

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

@laanwj

laanwj commented Jul 24, 2015

Copy link
Copy Markdown
Member

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
laanwj added a commit that referenced this pull request Jul 24, 2015
56b28fc Don't share objects between TestInstances (Casey Rodarmor)
@luke-jr

luke-jr commented Sep 20, 2015

Copy link
Copy Markdown
Member

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 September 20, 2015 08:19
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.
@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.

3 participants