ShaoHe Feng has posted comments on this change.

Change subject: tests: add a rollback manager for easy undoing
......................................................................


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

(3 inline comments)

DeferableContext can support the rollback as rollbackManager,   but it will 
raise the lastException when it exit,that's different.
 form the the Simple example foo of this patch, it give us the advance of first 
Exception.
 
 actually, I prefer rollbackManager. it can also support positive sequence, not 
only fallback.

 the problem is that Makes for a simpler interface.

 you have to sorted makefile list again, though you have sorted it.

....................................................
File tests/Makefile.am
Line 43:        permutationTests.py \
Line 44:        persistentDictTests.py \
Line 45:        restTests.py \
Line 46:        restData.py \
Line 47:        rollbackManagerTests.py \
the original list is not sorted. hehe
Line 48:        tcTests.py \
Line 49:        vdsClientTests.py \
Line 50:        remoteFileHandlerTests.py \
Line 51:        resourceManagerTests.py


....................................................
File tests/testrunner.py
Line 251:     to the list. The function will be put in the "with" statement, 
the return
Line 252:     value of the function will be assigned to the "as" variable. If an
Line 253:     exception is raised, whether it's raised in the function or in 
the block
Line 254:     under the "with" statement, the registered undo operations will 
be played
Line 255:     in reverse order. When peforming rollback, exceptions will be 
swalloweded
swalloweded -> swallowed ?
Line 256:     to let rollback continue, at last, the earliest exception with 
original
Line 257:     line number and stack trace infomation will be raised.
Line 258: 
Line 259:     Simple example:


Line 303:     for undo in rollback:
Line 304:         try:
Line 305:             undo()
Line 306:         except Exception as e:
Line 307:             # keep the earliest exception info
yes, the earliest exception info is more useful than the latest exception info.
 maybe the latest exception info was cause by the earliest exception.
 and you example give the reason.
Line 308:             if not exception:
Line 309:                 exception = e
Line 310:                 # keep the original traceback info
Line 311:                 traceback = sys.exc_info()[2]


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibc932637dd81c3becf92de34ea647c1cea136111
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Royce Lv <[email protected]>
Gerrit-Reviewer: Ryan Harper <[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]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to