Enable fatal_exception_format_errors in unit tests

Bug #1728984 reported by Eric Harney
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
Sean McGinnis

Bug Description

Unit tests should run with "fatal_exception_format_errors = True" in order to catch string formatting bugs.

TestCase includes
    self.override_config('fatal_exception_format_errors', True)

but this does not appear to be sufficient to achieve this. Changing the default value of the option to True results in unit tests failing with format errors, as demoed here:
    https://review.openstack.org/#/c/516384/1

IMO we should also enable this option in most tempest jobs.

Tags: tests
Changed in cinder:
importance: Undecided → Medium
Revision history for this message
Brin Zhang (zhangbailin) wrote :

Hi Eric, can't open your python-test: http://logs.openstack.org/84/516384/1/check/openstack-tox-py27/a50fbe1/
Can I mention one based on your review? Easy to engage in unit testing.
Thanks.

Changed in cinder:
assignee: nobody → Sean McGinnis (sean-mcginnis)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/541061
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=de59b02a388a96e06afcbc64c38650414bbed595
Submitter: Zuul
Branch: master

commit de59b02a388a96e06afcbc64c38650414bbed595
Author: Sean McGinnis <email address hidden>
Date: Mon Feb 5 16:54:36 2018 -0600

    Make CinderException format errors fatal for tests

    This patch borrows very heavily from Nova change
    I680fd46d029ff58bd3b72ef7c7903c2271b26549.

    We have a config option to treat exception message formatting errors
    as fatal, but it turned out our overriding of that config option was
    not actually working. Since this is really something only useful for
    testing, and we pretty much always want errors like that caught in
    testing, this deprecates the option and changes the code to always
    enforce raising errors during unit testing when there are problems
    formatting any exception messages.

    The previous config option is pretty much useless now, but this way
    we are following the deprecation policy and we can remove it right
    away in Rocky.

    Closes-Bug: #1728984
    Change-Id: Iaeb2657a6622cede32c5a59327393ca20758f3c3

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 12.0.0.0rc1

This issue was fixed in the openstack/cinder 12.0.0.0rc1 release candidate.

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.