[SERVER-21801] CheckReplDBHash testing hook should check document type (resmoke.py) Created: 08/Dec/15 Updated: 18/Nov/16 Resolved: 22/Jan/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Testing Infrastructure |
| Affects Version/s: | 3.2.0 |
| Fix Version/s: | 3.2.3, 3.3.1 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Robert Guo (Inactive) | Assignee: | Michael Grundy |
| Resolution: | Done | Votes: | 0 |
| Labels: | test-only | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Backport Completed: | |||||||||
| Sprint: | TIG E (01/08/16), TIG F (01/29/16) | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 0 | ||||||||
| Description |
|
Instead of doing
to compare 2 documents, we should check that each field is of the same type. We could miss things like:
|
| Comments |
| Comment by Githook User [ 25/Jan/16 ] | |||||||
|
Author: {u'username': u'mgrundy', u'name': u'Mike Grundy', u'email': u'michael.grundy@10gen.com'}Message: (cherry picked from commit ca39291d733cb2171be6bddcdda8ace8851b1906) | |||||||
| Comment by Githook User [ 22/Jan/16 ] | |||||||
|
Author: {u'username': u'mgrundy', u'name': u'Mike Grundy', u'email': u'michael.grundy@10gen.com'}Message: | |||||||
| Comment by Bernie Hackett [ 10/Dec/15 ] | |||||||
|
I suppose you could create a new subclass of dict to do that, or monkey patch SON, but we wouldn't make that change in PyMongo. SON works like OrderedDict:
| |||||||
| Comment by Max Hirschhorn [ 10/Dec/15 ] | |||||||
|
One option is to extend the bson.SON class and override the __eq__() method to make it check that the types of the values are also equal. Effectively we want bson.SON([('a', int(1))]) == bson.SON([('a', float(1))]) to return false instead of true. behackett, thoughts? | |||||||
| Comment by Robert Guo (Inactive) [ 08/Dec/15 ] | |||||||
|
Oops, I forgot to mention this was Python code. | |||||||
| Comment by Eric Milkie [ 08/Dec/15 ] | |||||||
|
Triple equals to the rescue? |