Stress Test - tearDown() not called if an exception occurred

Bug #1273245 reported by Julien Leloup
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
Fix Released
Undecided
Julien Leloup

Bug Description

The class "UnitTest" inside the Stress Test part of Tempest can call tearDownClass() either during it's own tearDown() or at the end of a run() execution, allowing the tearDownClass() to be called after each cycle of the stress test with the @stresstest decorator parameter "class_setup_per")

At the moment if an exception occurs during the run tearDownClass() is not called at the end of run() even if "class_setup_per" is set to "action" (no try / except block).

I propose to put a try / except block to in order to catch exception occuring in run_cycle(),and eventually call the tearDownClass() if relevent before raising the exception again.

If this behaviour (no tearDownClass() if there is an exception) should be left, maybe in order to leave OpenStack in a dirty state for debugging purposes, I propose to have a parameter set in tempest.conf called "leave_dirty_stack" with a default value set to False:
- True : tearDownClass() is not called upon exception in order to allow an operator/developper to have the stack in the exact state of the moment the error occured
- False : tearDownClass() is called upon exception in order to get OpenStack in the same state it was before running the test.

Note : this defect is slightly linked to this one "https://bugs.launchpad.net/tempest/+bug/1273254". If the community think the new parameter I propose here should be the same that I propose in this other ticket, it seems relevant to have only one parameter for both issues for simplicity sake even if the meaning of these parameters is not exactly the same.

description: updated
description: updated
summary: - Stress Test - tearDown() not called if an exception occured
+ Stress Test - tearDown() not called if an exception occurred
Marc Koderer (m-koderer)
Changed in tempest:
status: New → Confirmed
Changed in tempest:
assignee: nobody → Julien Leloup (julien-llp)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tempest (master)

Fix proposed to branch: master
Review: https://review.openstack.org/69641

Changed in tempest:
status: Confirmed → In Progress
Revision history for this message
Julien Leloup (julien-llp) wrote :

This patch is actually not building with Jenkins due to bug "https://bugs.launchpad.net/subunit/+bug/1274056", Fails with testtools == 0.9.35

Should I wait for this bug to be resolved before reviewing my pathc once more or should I merge a patch proposed for this bug in my own patch ?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tempest (master)

Reviewed: https://review.openstack.org/69641
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=04d40f73b7f6130adbc11d70cf74410bd0ba4775
Submitter: Jenkins
Branch: master

commit 04d40f73b7f6130adbc11d70cf74410bd0ba4775
Author: Julien Leloup <julien.leloup@3ds.com>
Date: Tue Jan 28 11:17:18 2014 +0100

    Clean/leave OpenStack after a stress test

    New parameter "leave_dirty_stack" available in tempest.conf
    to prevent (or not) the execution of tearDownClass()
    after an exception during a stress test

    Closes-Bug: #1273245
    Change-Id: I89ecac1fb428cf8809a3634869f2dfdf564aea64

Changed in tempest:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.