Zhou Zheng Sheng has posted comments on this change.

Change subject: itmap unit tests
......................................................................


Patch Set 10: I would prefer that you didn't submit this

(4 inline comments)

....................................................
File tests/miscTests.py
Line 200: class ITMap(TestCaseBase):
Line 201:     def testMoreArgsThanThreads(self):
Line 202:         def dummy(arg):
Line 203:             # each thread takes at least 1 second
Line 204:             time.sleep(0.5)
Please update the number of second in the comment as well.
Line 205:             return arg
Line 206:         data = frozenset([1, 2, 3, 4])
Line 207:         currentTime = time.time()
Line 208:         # we provide 3 thread slots and the input contain 4 vals, 
means we


Line 211:         afterTime = time.time()
Line 212:         # the time should take at least 0.5sec to wait for 1 of the 
first 3 to
Line 213:         # finish and another 0.5sec for the last operation,
Line 214:         # not more than 2 seconds (and I'm large here..)
Line 215:         self.assertFalse(currentTime + 2 < afterTime,
"afterTime - currentTime > 2" is more readable to me.

Can I suggest changing the name of "currentTime" to "beginTime"?
Line 216:                 msg="Operation took too long (more than 2 second). 
starts: " +
Line 217:                 str(currentTime) + " ends: " + str(afterTime))
Line 218:         # Verify the operation took at least 1 second
Line 219:         self.assertFalse(currentTime + 1 > afterTime,


Line 215:         self.assertFalse(currentTime + 2 < afterTime,
Line 216:                 msg="Operation took too long (more than 2 second). 
starts: " +
Line 217:                 str(currentTime) + " ends: " + str(afterTime))
Line 218:         # Verify the operation took at least 1 second
Line 219:         self.assertFalse(currentTime + 1 > afterTime,
"afterTime - currentTime < 1" is more readable to me.
Line 220:                 msg="Operation was too fast, not all threads were "
Line 221:                     "initiated as desired (with 1 thread delay)")
Line 222:         self.assertEquals(ret, data)
Line 223: 


Line 217:                 str(currentTime) + " ends: " + str(afterTime))
Line 218:         # Verify the operation took at least 1 second
Line 219:         self.assertFalse(currentTime + 1 > afterTime,
Line 220:                 msg="Operation was too fast, not all threads were "
Line 221:                     "initiated as desired (with 1 thread delay)")
If the operation is too fast, does that mean more threads than 3 are initiated?
Line 222:         self.assertEquals(ret, data)
Line 223: 
Line 224:     def testMaxAvailableProcesses(self):
Line 225:         def dummy(arg):


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I26e258a035f49a8ecd57e992b9a68b9475a58839
Gerrit-PatchSet: 10
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Hunt Xu <[email protected]>
Gerrit-Reviewer: Saggi Mizrahi <[email protected]>
Gerrit-Reviewer: ShaoHe Feng <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: Zhou Zheng Sheng <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to