Vinzenz Feenstra has posted comments on this change.

Change subject: Improvement of the GuestAgent class memory usage
......................................................................


Patch Set 9: (2 inline comments)

....................................................
File tests/guestIFTests.py
Line 149:         for chunk in self.messageChunks(input, (self.maxMessageSize / 
2) + 1):
Line 150:             self.fakeGuestAgent._handleData(chunk)
Line 151: 
Line 152:         for (k, v) in expected.iteritems():
Line 153:             self.assertEqual(self.fakeGuestAgent.guestInfo[k], 
expected[k])
Here is no length check needed. by default all messages in expected are the 
defaults, and the loop with the comment 'Building big blob of data from test 
inputs' takes care of overriding the default with the expected default if the 
message is not too long.
Line 154: 
Line 155:     def testMixed(self):
Line 156:         testCase = namedtuple('testCase', 'msgType, message, 
assertDict')
Line 157:         for t in zip(_MSG_TYPES, _INPUTS, _OUTPUTS):


Line 177:                                      self.infoDefaults[k])
Line 178:                 else:
Line 179:                     # If the message size was within the allowed range
Line 180:                     # the message should have been put into the 
guestInfo dict
Line 181:                     
self.assertEqual(self.fakeGuestAgent.guestInfo[k], v)
Well the idea here is that it actually should fail if the assumptions are 
wrong. If am resetting the defaults on every test case we might miss failures.
This way we can ensure that there are no failures missed, since the idea here 
is to test mixed length messages, over-length and normal length.


--
To view, visit http://gerrit.ovirt.org/9239
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibf6274bb10c9e3b80962b69c5df316f03ee21214
Gerrit-PatchSet: 9
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Gal Hammer <[email protected]>
Gerrit-Reviewer: Igor Lvovsky <[email protected]>
Gerrit-Reviewer: Peter V. Saveliev <[email protected]>
Gerrit-Reviewer: Saggi Mizrahi <[email protected]>
Gerrit-Reviewer: ShaoHe Feng <[email protected]>
Gerrit-Reviewer: Vinzenz Feenstra <[email protected]>
Gerrit-Reviewer: Zhou Zheng Sheng <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to