Nova unit tests fail if OS_DEBUG=True

Bug #1964497 reported by Uggla
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Unassigned

Bug Description

Description
===========
Nova unit tests fail if OS_DEBUG=True
The following test fails nova.tests.unit.test_fixtures.TestLogging.test_default_logging

Steps to reproduce
==================
1- Set OS_DEBUG to True:
$ export OS_DEBUG=True

2- Run tox unit tests:
$ tox -e py39 "nova.tests.unit.test_fixtures.TestLogging.test_default_logging"

Expected result
===============
Tests ok

Actual result
=============
Test fails (see full log below)

Environment
===========
Yoga (master branch)

Logs & Configs
==============
Please look at attach log.

Revision history for this message
Uggla (rene-ribaud) wrote :
Revision history for this message
Uggla (rene-ribaud) wrote :
summary: - Nova unit tests fails if OS_DEBUG=True
+ Nova unit tests fail if OS_DEBUG=True
description: updated
Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.opendev.org/c/openstack/nova/+/833115
Committed: https://opendev.org/openstack/nova/commit/84c6d05ac343029cf151c35d4696cee0dc74f2c9
Submitter: "Zuul (22348)"
Branch: master

commit 84c6d05ac343029cf151c35d4696cee0dc74f2c9
Author: Artom Lifshitz <email address hidden>
Date: Thu Mar 10 10:53:13 2022 -0500

    Fix unit tests when they are run with OS_DEBUG=True

    This patch fix test_default_logging test.
    The test validates that we have two logging handlers:
    1 x to display default messages (info, error, warnings...)
    1 x to redirect debug messages to null and so don't display them.

    However, if OS_DEBUG=True is set in a shell session, then the test is
    run and fails. Because, in debug mode, we should have only one handler
    to display all messages. (look at comments for more details and
     test_debug_logging test).

    To fix the test, we explicitly set OS_DEBUG=0 when running
    test_default_logging, so it will ensure we have two handlers whatever
    OS_DEBUG value.

    Co-authored-by: Rene Ribaud <email address hidden>
    Closes-Bug: #1964497

    Change-Id: I7c0151d988c538dd2d083aab4b3e18ddb8151045

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

This issue was fixed in the openstack/nova 26.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

Bug attachments

Remote bug watches

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