[Kimchi-devel] [PATCH 4/5] ModelTests: Improve leftover cleaning

Crístian Viana vianac at linux.vnet.ibm.com
Tue Oct 28 12:43:35 UTC 2014


As I wrote on the patch 3/5, I think you should only add the deletion 
rollback calls after you're sure the resource has been created (i.e. 
after waiting for its task to finish).

On 28-10-2014 04:48, Zhou Zheng Sheng wrote:
> In ModelTests we use RollbackContext to register undo actions for
> cleaning leftovers. The general principle for using RollbackContext is
> that we should register an undo action right after the successful
> allocation of a resource, otherwise we leave a window between the
> resource allocation and cleanup action registration. If it happened to
> raise an exception in this window, the allocated resource is not
> cleaned.
>
> In ModelTests, you can find that some test methods is not properly using
> RollbackContext, they place assertions between resource allocation and
> cleanup registration. This patch tries to adjust the order peroperly.




More information about the Kimchi-devel mailing list