Wednesday, 2025-05-14

opendevreviewchandan kumar proposed openstack/watcher master: Drop code from Host maintenance strategy migrating instance to disabled hosts  https://review.opendev.org/c/openstack/watcher/+/94896703:55
opendevreviewchandan kumar proposed openstack/watcher stable/2025.1: Drop nova command reference from the code  https://review.opendev.org/c/openstack/watcher/+/94969303:59
opendevreviewchandan kumar proposed openstack/watcher stable/2024.2: Drop nova command reference from the code  https://review.opendev.org/c/openstack/watcher/+/94969404:01
opendevreviewAlfredo Moralejo proposed openstack/watcher master: Return HTTP code 400 when creating an audit with wrong parameters  https://review.opendev.org/c/openstack/watcher/+/94970307:48
opendevreviewDavid proposed openstack/watcher-tempest-plugin master: Refactor of wait_for_instances_in_model function to wait until all instances are in the correct compute node on the model  https://review.opendev.org/c/openstack/watcher-tempest-plugin/+/94965708:41
opendevreviewDavid proposed openstack/watcher-tempest-plugin master: Refactor of wait_for_instances_in_model function to wait until all instances are in the correct compute node on the model  https://review.opendev.org/c/openstack/watcher-tempest-plugin/+/94965709:18
jgilabersean-k-mooney: some more context on my question from yesterday. It was about the bug https://bugs.launchpad.net/watcher/+bug/211014910:09
jgilaberthis debug call https://github.com/openstack/watcher/blob/77e7e4ef7b5b0cd29e27b3529fdac4fdc2287d40/watcher/common/nova_helper.py#L732 is wrong  and there are a few similar ones in cinder-helper10:09
jgilaberbut because the unit test have the logging disabled, this was not noticed10:10
jgilaberin https://review.opendev.org/c/openstack/watcher/+/949187 I managed to make the error visible, but it feels really hacky, and I guessed there must be a better way10:10
sean-k-mooneyjgilaber: so i have not looked at watches based test yet but oslo.test has some standard logging fixture whice we normally use10:16
sean-k-mooneyso logging should not be disable dby default in the test but the logs should be captured by the test fixture10:17
sean-k-mooneythe question is is watcher using that and using it properly10:17
jgilaberthis is what you mean? https://docs.openstack.org/oslotest/latest/reference/api/oslotest.log.html#oslotest.log.ConfigureLogging10:21
jgilaberthe only reference to oslotest that I see in watcher is the use BaseTestCase https://github.com/openstack/watcher/blob/59607f616a0a7c8e38f488922ec3c27dffe692e7/watcher/tests/base.py#L4310:23
sean-k-mooneyyes so nova has its own standard logign fixture that predates that to make sure that logging is properly cofnigured in the test case  https://github.com/openstack/nova/blob/master/nova/tests/fixtures/nova.py#L126-L19910:24
sean-k-mooneyso nova disables the base capture log fixture https://github.com/openstack/nova/blob/master/nova/test.py#L187-L18810:25
sean-k-mooneybut normlaly we would use that to ensure that logging is configure properly in the tests10:25
jgilaberok, that looks promising, I'll give it a shot, thanks!10:26
sean-k-mooneyyou proably could copy paste the nova StandardLogging fixture to get a workable baseline10:29
jgilaberyep, I'll use that as a start10:30
opendevreviewDavid proposed openstack/watcher-tempest-plugin master: Add tests for workload_balance with injected data  https://review.opendev.org/c/openstack/watcher-tempest-plugin/+/94972210:36
sean-k-mooneyjgilaber: by the way we also often just do this https://github.com/openstack/nova/blob/eb5a4a7f3b0b8c3967c42a537cca766144eff25b/nova/tests/unit/virt/libvirt/volume/test_mount.py#L571-L58111:03
sean-k-mooneyin openstack we have the pattern of creatign a module level logger.11:04
sean-k-mooneythat means you can simply mock that in a test and then do asserts if you want to assert specific log output11:04
sean-k-mooneywe use the fixture for generic log assertions and capture11:05
sean-k-mooneyboth patthern have there place but just wanted you to be aware fo that pattern as well11:05
jgilaberthanks, that might be useful in the future11:06
sean-k-mooneyits useful if you creating a repoducer test and you want to assert forexample that an specific excption message is logged 11:07
sean-k-mooneyi.e. if your replciating a failure form a bug report11:07
sean-k-mooneyjgilaber: https://github.com/openstack/nova/blob/eb5a4a7f3b0b8c3967c42a537cca766144eff25b/nova/tests/unit/virt/libvirt/cpu/test_core.py#L56-L6011:12
sean-k-mooneywhen your usign the logging fixture you access the loggers output by self.stdlog.logger.output11:12
jgilaberyep, that's something I wanted to do11:13
sean-k-mooneyim just calling htat out because i dotn know if self.assertlogs will work with that fixture11:13
jgilaberlooks much cleaner, I'll try to get it working this afternoon11:13
sean-k-mooneyit may be our loging fixtures predate that11:13
sean-k-mooneyi belive how this works internally is we are configuring pythons loggin infra to log to an StringIO stream11:14
sean-k-mooneyso assertLogs has the potential to work but i dont use that normlaly11:15
opendevreviewsean mooney proposed openstack/watcher-dashboard master: add pyproject.toml to support pip 23.1  https://review.opendev.org/c/openstack/watcher-dashboard/+/94973712:48
opendevreviewsean mooney proposed openstack/watcher-tempest-plugin master: add pyproject.toml to support pip 23.1  https://review.opendev.org/c/openstack/watcher-tempest-plugin/+/94973812:51
opendevreviewsean mooney proposed openstack/python-watcherclient master: add pyproject.toml to support pip 23.1  https://review.opendev.org/c/openstack/python-watcherclient/+/94973912:51
opendevreviewDavid proposed openstack/watcher-tempest-plugin master: Add tests for workload_balance with injected data  https://review.opendev.org/c/openstack/watcher-tempest-plugin/+/94972213:05
opendevreviewAlfredo Moralejo proposed openstack/watcher master: Return HTTP code 400 when creating an audit with wrong parameters  https://review.opendev.org/c/openstack/watcher/+/94970315:05
opendevreviewAlfredo Moralejo proposed openstack/watcher master: Add a unit test to check the error when creating an audit with wrong parameters  https://review.opendev.org/c/openstack/watcher/+/94976915:05
opendevreviewDavid proposed openstack/watcher-tempest-plugin master: Add tests for workload_balance with injected data  https://review.opendev.org/c/openstack/watcher-tempest-plugin/+/94972215:10
opendevreviewDavid proposed openstack/watcher-tempest-plugin master: Add metrics for RAM to gnocchi and prometheus injected data  https://review.opendev.org/c/openstack/watcher-tempest-plugin/+/94977315:22
opendevreviewDavid proposed openstack/watcher-tempest-plugin master: Add metrics for RAM to gnocchi and prometheus injected data Required by futures tests of strategies that use memory as parameter for the audits  https://review.opendev.org/c/openstack/watcher-tempest-plugin/+/94977315:23
opendevreviewDavid proposed openstack/watcher-tempest-plugin master: Add tests for workload_balance with injected data  https://review.opendev.org/c/openstack/watcher-tempest-plugin/+/94972215:43
jgilabersean-k-mooney: the logging stuff turned out to be a deeper rabbit hole that I expected16:39
jgilaberI added the nova fixture but that did not solve the problem, the logging was still disabled16:39
sean-k-mooney:)16:39
jgilaberI finally managed to track what is disabling16:39
sean-k-mooneyoh cool16:39
jgilaberit's this https://github.com/openstack/watcher/blob/59607f616a0a7c8e38f488922ec3c27dffe692e7/watcher/db/sqlalchemy/alembic/env.py#L2616:40
sean-k-mooneywhat16:40
jgilabercalled from https://github.com/openstack/watcher/blob/master/watcher/tests/db/base.py#L5616:40
sean-k-mooneyhow16:40
jgilaberthe setup for the db tests calls alembic stamp16:40
jgilaberwhich loads the env.py16:40
sean-k-mooneyrieght btu that is defintly not intentional16:40
jgilaberyes, that is a side effect16:40
sean-k-mooneyok that tracks we whoudl liketly isolate the effect on the config16:41
jgilaberapparently allembic generates a ini file on the fly whichs configures logging as well16:41
sean-k-mooneyyep it does16:42
jgilaberand that for some reason disables the watcher logging16:42
sean-k-mooneyso this is runnign as a sideefect fo the import16:42
sean-k-mooneywhich is not whoe we shoudl be doign that16:42
jgilaberI just tried uncommenting the env.py and we get 7 unit test failures during logging (3 of those are new yay!)16:42
sean-k-mooneyim just looking at how we handel this in other service like placement/nova16:43
sean-k-mooneywe can likely takek the same approch in watcher ot the alembic migrations16:44
sean-k-mooneyso they use a db fixture also but the logic is a bit different16:46
jgilabernova avoids configuring the logging in alembic https://github.com/openstack/nova/blob/eb5a4a7f3b0b8c3967c42a537cca766144eff25b/nova/db/migration.py#L5016:46
jgilaberwith a condition in the env.py https://github.com/openstack/nova/blob/eb5a4a7f3b0b8c3967c42a537cca766144eff25b/nova/db/api/migrations/env.py#L27C27-L27C4316:46
sean-k-mooneyya that an option16:46
sean-k-mooneyplacement also does not seam to configure the logging16:48
sean-k-mooneywe can take the same apprcoh either by following placements lead https://github.com/openstack/placement/blob/master/placement/db/sqlalchemy/alembic/env.py and just not invokeing that on import16:52
sean-k-mooneyor by explcitly disabling it like nova does16:52
sean-k-mooneyjgilaber: im leaning toworads just deleteing https://github.com/openstack/watcher/blob/master/watcher/db/sqlalchemy/alembic/env.py#L24-L26 honestly16:53
sean-k-mooneyjgilaber: this unfortuently dates form the inital import of the git repo so we do not have any context in git blame16:55
jgilaberlooking at the comment in nova code https://github.com/openstack/nova/blob/eb5a4a7f3b0b8c3967c42a537cca766144eff25b/nova/db/migration.py#L49C7-L49C5016:56
jgilaberit seems that this logging is only important when running alembic from cli16:56
jgilabernot sure if this would affect also running watcher-db-manage?16:57
jgilaberthere is also a simple solution of adding 'disable_existing_loggers=False' to the fileConfig call in env.py16:57
sean-k-mooneyit would but all loging is ment to be confired via oslo in that case16:57
jgilaberthat leaves the existing logging alone16:57
sean-k-mooneyi think this is legacy code form the inital import that should have been updated hwen oslo.log was intoduced16:58
jgilaberack, in that case I'll remove it 16:58
jgilaberthanks!16:58
opendevreviewJaromír Wysoglad proposed openstack/watcher-specs master: Support multitenancy with Prometheus datasource  https://review.opendev.org/c/openstack/watcher-specs/+/94980420:56

Generated by irclog2html.py 4.0.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!