Page MenuHomePhabricator

mtail testing infrastructure prints python deprecation warnings
Closed, ResolvedPublic

Description

Whenever there's a failure running a mtail program test, the following warnings are shown:

=============================== warnings summary ===============================
modules/mtail/files/test/varnish_test.py::VarnishSLITest::testSLI
  /home/ema/wmf/operations-puppet/modules/mtail/files/test/mtail_store.py:39: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
    log.warn("mtail path: {}".format(shutil.which("mtail")))

modules/mtail/files/test/varnish_test.py::VarnishSLITest::testSLI
  /home/ema/wmf/operations-puppet/modules/mtail/files/test/mtail_store.py:41: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
    log.warn(subprocess.check_output(['dpkg-query', '-W', 'mtail']))

modules/mtail/files/test/varnish_test.py::VarnishSLITest::testSLI
  /home/ema/wmf/operations-puppet/modules/mtail/files/test/mtail_store.py:42: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
    log.warn(stderr)

-- Docs: https://docs.pytest.org/en/stable/warnings.html

We should be using log.warning instead of log.warn in modules/mtail/files/test/mtail_store.py.

Event Timeline

Change 702110 had a related patch set uploaded (by Filippo Giunchedi; author: Filippo Giunchedi):

[operations/puppet@production] mtail: use non-deprecated log.warning

https://gerrit.wikimedia.org/r/702110

Change 702116 had a related patch set uploaded (by Filippo Giunchedi; author: Filippo Giunchedi):

[operations/puppet@production] mtail: parse 3.0.0~rc43 store format

https://gerrit.wikimedia.org/r/702116

Change 702110 merged by Filippo Giunchedi:

[operations/puppet@production] mtail: use non-deprecated log.warning

https://gerrit.wikimedia.org/r/702110

Change 702116 merged by Filippo Giunchedi:

[operations/puppet@production] mtail: parse 3.0.0~rc43 store format

https://gerrit.wikimedia.org/r/702116

herron triaged this task as Medium priority.Jul 1 2021, 5:15 PM
ema claimed this task.
ema added a subscriber: fgiunchedi.

Thanks @fgiunchedi, I just verified that this is now fixed.