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 protected]> 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 protected]> Closes-Bug: #1964497 Change-Id: I7c0151d988c538dd2d083aab4b3e18ddb8151045 ** Changed in: nova Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Compute (nova). https://bugs.launchpad.net/bugs/1964497 Title: Nova unit tests fail if OS_DEBUG=True Status in OpenStack Compute (nova): Fix Released 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. To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1964497/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

