DO NOT MERGE - cut-down tests to show random FilterDict test failure#180
Closed
tomlongridge wants to merge 4 commits into
Closed
DO NOT MERGE - cut-down tests to show random FilterDict test failure#180tomlongridge wants to merge 4 commits into
tomlongridge wants to merge 4 commits into
Conversation
…data adds version string (from platform.python_version()) to device.runtimeVersions.python payload
kattrali
added a commit
that referenced
this pull request
Jun 12, 2019
References to nested dicts/field are recycled when going out of scope, which is immediately since the references are not retained for the lifetime of the sanitization pass. This change keeps references to seen nested objects in addition to ignored objects to ensure id() returns unique references. Related reports on the Python issue tracker which explain the issue: * https://bugs.python.org/issue36156 * https://bugs.python.org/issue33685 >>> help(id) Help on built-in function id in module __builtin__: id(...) id(object) -> integer Return the identity of an object. This is guaranteed to be unique among simultaneously existing objects. (Hint: it's the object's memory address.) Closes #180
3 tasks
Contributor
Author
|
Fixed in #181 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
In trying to add runtime information to the device payload I've added a nested dict to the structure and this seems to be failing unit tests sporadically. I have reduced the payload in a unit test down to the following:
It's the addition of the last dict that I'm trying to achieve and yet it doesn't occur if I remove the other FilterDict or the simple string pair preceding it.
I've added the
test_to_death_tx.shscript that can be run to continuously run the tests - they fail after <10 usually. It only seems to fail through tox on python3.5 and before - running nosetest doesn't seem to make it fail.I've added print lines to the utils function to show what's happening and on a failed test you can see two dict's added to the
ignoredlist with the sameiddespite being different objects.It is always a clash between
level4-key1andlevel4-key2:I wondered whether it was to do with the order of dict iteration being undefined but it doesn't seem to fix it with a sorted list either.