Public bug reported:

tearDown should be replace by addCleanup  in the unit tests to avoid
stale state if setUp fails or any failure in tearDown method.

There is a bp in cinder project, just copy them here for reference,
"Infra team has indicated that tearDown methods should be replaced with 
addCleanup in unit tests.
The reason is that all addCleanup methods will be executed even if one of them 
fails, while a failure in tearDown method can leave the rest of the tearDown 
un-executed, which can leave stale state laying around.

Moreover, tearDown methods won't run if an exception raises in setUp
method, while addCleanup will run in such case.

So, we should replace tearDown with addCleanup methods."

Since there tearDown method is not used widely in keystone sub-project,
so just file a bug to track the change."


The link of the reference: 
https://blueprints.launchpad.net/cinder/+spec/replace-teardown-with-addcleanup

** Affects: keystone
     Importance: Undecided
     Assignee: Dave Chen (wei-d-chen)
         Status: In Progress

** Changed in: keystone
     Assignee: (unassigned) => Dave Chen (wei-d-chen)

** Description changed:

  tearDown should be replace by addCleanup  in the unit tests to avoid
  stale state if setUp fails or any failure in tearDown method.
  
  There is a bp in cinder project, just copy them here for reference,
  "Infra team has indicated that tearDown methods should be replaced with 
addCleanup in unit tests.
  The reason is that all addCleanup methods will be executed even if one of 
them fails, while a failure in tearDown method can leave the rest of the 
tearDown un-executed, which can leave stale state laying around.
  
  Moreover, tearDown methods won't run if an exception raises in setUp
  method, while addCleanup will run in such case.
  
  So, we should replace tearDown with addCleanup methods."
  
+ Since there tearDown method is not used widely in keystone sub-project,
+ so just file a bug to track the change."
  
- Since there tearDown method is not used widely in keystone sub-project, so 
just file a bug to track the change.
+ 
+ The link of the reference: 
https://blueprints.launchpad.net/cinder/+spec/replace-teardown-with-addcleanup

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1480119

Title:
  Replace tearDown with addCleanup in unit tests

Status in Keystone:
  In Progress

Bug description:
  tearDown should be replace by addCleanup  in the unit tests to avoid
  stale state if setUp fails or any failure in tearDown method.

  There is a bp in cinder project, just copy them here for reference,
  "Infra team has indicated that tearDown methods should be replaced with 
addCleanup in unit tests.
  The reason is that all addCleanup methods will be executed even if one of 
them fails, while a failure in tearDown method can leave the rest of the 
tearDown un-executed, which can leave stale state laying around.

  Moreover, tearDown methods won't run if an exception raises in setUp
  method, while addCleanup will run in such case.

  So, we should replace tearDown with addCleanup methods."

  Since there tearDown method is not used widely in keystone sub-
  project, so just file a bug to track the change."

  
  The link of the reference: 
https://blueprints.launchpad.net/cinder/+spec/replace-teardown-with-addcleanup

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1480119/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to