[SRU] work-around for test_hacking failures with new versions of python

Bug #1782786 reported by Corey Bryant on 2018-07-20
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Cloud Archive
Status tracked in Stein
Queens
High
Unassigned
Rocky
High
Unassigned
Stein
High
Unassigned
nova (Ubuntu)
Status tracked in Eoan
Bionic
High
Unassigned
Cosmic
High
Unassigned
Disco
High
Unassigned
Eoan
High
Unassigned

Bug Description

This bug is tracking an SRU for the work-around fix for https://bugs.launchpad.net/cloud-archive/+bug/1804062.

[Impact]
test_hacking fails with new versions of python 2.7, 3.6, and 3.7. See https://bugs.launchpad.net/cloud-archive/+bug/1804062 for more details.

[Test Case]
Build the nova package and it will run unit tests. With the work-around, test_hacking is skipped, and tests will be successful.

[Regression Potential]
Very low. test_hacking will be skipped which decreases testing coverage. This is a temporary fix until an official fix lands for https://bugs.launchpad.net/cloud-archive/+bug/1804062.

--------------------------------------------

Note: The original bug description was changed. See details in comment #7: https://bugs.launchpad.net/nova/+bug/1782786/comments/7.

=== Original Bug Description ===

I'm hitting 2 remaining test failures after other py3.7 fixes have landed [1]:

test_validate_patternProperties_fails
  TypeError: expected string or bytes-like object

test_name_with_non_printable_characters
  testtools.matchers._impl.MismatchError

Full tracebacks: https://paste.ubuntu.com/p/hY4N3Yx7FW/

[1] https://review.openstack.org/#/c/584365/

summary: - py3.7 test failures
+ py3.7 test failures - expected string or bytes-like object and
+ _impl.MismatchError
description: updated

Here's one more error I'm seeing for py3.7:

======================================================================
FAIL: nova.tests.unit.test_hacking.HackingTestCase.test_check_doubled_words
nova.tests.unit.test_hacking.HackingTestCase.test_check_doubled_words
----------------------------------------------------------------------
_StringException: Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/nova/tests/unit/test_hacking.py", line 586, in test_check_doubled_words
    expected_errors=errors)
  File "/<<PKGBUILDDIR>>/nova/tests/unit/test_hacking.py", line 293, in _assert_has_errors
    self.assertEqual(expected_errors or [], actual_errors)
  File "/usr/lib/python3/dist-packages/testtools/testcase.py", line 411, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/usr/lib/python3/dist-packages/testtools/testcase.py", line 498, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: [(1, 0, 'N343')] != []

tags: added: testing
Matt Riedemann (mriedem) on 2018-07-24
tags: added: py37
James Page (james-page) wrote :

The error in #1 I'm now seeing on 2.7/3.6/3.7 (based on snapshots shipping in Ubuntu Cosmic).

Corey Bryant (corey.bryant) wrote :

Hmmm, now seeing the error in #1 on bionic for python 2.7.

Corey Bryant (corey.bryant) wrote :

For the error in #1, at least on bionic, it appears that physical_line empty in check_double_words:

def check_doubled_words(physical_line, filename):
    """Check for the common doubled-word typos

    N343
    """
    msg = ("N343: Doubled word '%(word)s' typo found")

    match = re.search(doubled_words_re, physical_line)

    if match:
        return (0, msg % {'word': match.group(1)})

Corey Bryant (corey.bryant) wrote :

And since physical_line is empty, match evaluates to false.

Corey Bryant (corey.bryant) wrote :

We can stop tracking [1] in this bug as it's already being tracked at https://bugs.launchpad.net/nova/+bug/1804062.

Corey Bryant (corey.bryant) wrote :

The original 2 test failures reported in this bug (test_validate_patternProperties_fails and test_name_with_non_printable_characters) were fixed upstream in nova by Chris Dent in commit 2ea552e019bd427b5b1709160a6ed7da9dd23fbd.

Since https://bugs.launchpad.net/cloud-archive/+bug/1804062 has a related-fix to "Skip double word hacking test" until it can be officially fixed, perhaps we can track that work-around here and track the official fix at 1804062. (I don't want to track the work-around in 1804062 as the SRU would close that out as fix released once released.)

I'm going to go ahead and update this bug to track the work-around SRU.

description: updated
summary: - py3.7 test failures - expected string or bytes-like object and
- _impl.MismatchError
+ [SRU] test_hacking fails for new versions of python
summary: - [SRU] test_hacking fails for new versions of python
+ [SRU] work-around for test_hacking fails for new versions of python
summary: - [SRU] work-around for test_hacking fails for new versions of python
+ [SRU] work-around for test_hacking failures with new versions of python
no longer affects: nova
description: updated
Changed in nova (Ubuntu Eoan):
status: New → Fix Released
Changed in nova (Ubuntu Disco):
status: New → Fix Released
Changed in nova (Ubuntu Cosmic):
status: New → Fix Released
Changed in nova (Ubuntu Bionic):
status: New → Triaged
importance: Undecided → High
Changed in nova (Ubuntu Cosmic):
importance: Undecided → High
Changed in nova (Ubuntu Disco):
importance: Undecided → High
Changed in nova (Ubuntu Eoan):
importance: Undecided → High
Corey Bryant (corey.bryant) wrote :

A new version of nova with this fix have been uploaded to bionic where it is awaiting review from the SRU team [1].

[1] https://launchpad.net/ubuntu/bionic/+queue?queue_state=1&queue_text=nova

Hello Corey, or anyone else affected,

Accepted nova into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/nova/2:17.0.9-0ubuntu2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in nova (Ubuntu Bionic):
status: Triaged → Fix Committed
tags: added: verification-needed verification-needed-bionic
Corey Bryant (corey.bryant) wrote :

Hello Corey, or anyone else affected,

Accepted nova into queens-proposed. The package will build now and be available in the Ubuntu Cloud Archive in a few hours, and then in the -proposed repository.

Please help us by testing this new package. To enable the -proposed repository:

  sudo add-apt-repository cloud-archive:queens-proposed
  sudo apt-get update

Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-queens-needed to verification-queens-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-queens-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-queens-needed
Łukasz Zemczak (sil2100) wrote :

Hello Corey, or anyone else affected,

Accepted nova into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/nova/2:17.0.9-0ubuntu3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Corey Bryant (corey.bryant) wrote :

Package builds were successful for 2:17.0.9-0ubuntu2+ in bionic-proposed and queens-proposed which means unit tests were run successfully, therefore tagged as verified.

tags: added: verification-done verification-done-bionic verification-queens-done
removed: verification-needed verification-needed-bionic verification-queens-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nova - 2:17.0.9-0ubuntu3

---------------
nova (2:17.0.9-0ubuntu3) bionic; urgency=medium

  * d/p/bug_1825882.patch: Cherry-picked from upstream to ensure
    virsh disk attach does not fail silently (LP: #1825882).
  * d/p/bug_1826523.patch: Cherry-picked from upstream to ensure
    always disconnect volumes after libvirt exceptions (LP: #1826523).

nova (2:17.0.9-0ubuntu2) bionic; urgency=medium

  * d/p/xenapi-agent-change-openssl-error-handling.patch: Cherry-picked from
    upstream to ensure xenapi agent only raises a RuntimeError exception
    when openssl returns a non-zero exit code (LP: #1771506).
  * d/p/skip-double-word-hacking-test.patch: Cherry-picked from upstream
    to work-around test_hacking failures with new versions of python
    (LP: #1782786).

 -- Sahid Orentino Ferdjaoui <email address hidden> Thu, 16 May 2019 11:06:11 +0200

Changed in nova (Ubuntu Bionic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers