migrate.tests.versioning.test_script.TestPyScript.test_verify_nofuncs randomly fails on py34

Bug #1475339 reported by Matt Riedemann
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
sqlalchemy-migrate
Fix Committed
High
Matt Riedemann

Bug Description

http://logs.openstack.org/70/202170/2/check/gate-sqlalchemy-migrate-python34/b8fe666/console.html#_2015-07-15_19_57_57_943

This seemed to just start in the last week or so, I'm not sure what changed:

2015-07-15 19:57:57.943 | {0} migrate.tests.versioning.test_script.TestPyScript.test_verify_nofuncs [0.002325s] ... FAILED
2015-07-15 19:57:57.943 |
2015-07-15 19:57:57.943 | Captured traceback:
2015-07-15 19:57:57.943 | ~~~~~~~~~~~~~~~~~~~
2015-07-15 19:57:57.944 | Traceback (most recent call last):
2015-07-15 19:57:57.944 | File "/home/jenkins/workspace/gate-sqlalchemy-migrate-python34/migrate/tests/versioning/test_script.py", line 104, in test_verify_nofuncs
2015-07-15 19:57:57.944 | self.assertRaises(exceptions.InvalidScriptError, self.cls.verify_module, path)
2015-07-15 19:57:57.944 | File "/home/jenkins/workspace/gate-sqlalchemy-migrate-python34/.tox/py34/lib/python3.4/site-packages/testtools/testcase.py", line 393, in assertRaises
2015-07-15 19:57:57.944 | self.assertThat(our_callable, matcher)
2015-07-15 19:57:57.944 | File "/home/jenkins/workspace/gate-sqlalchemy-migrate-python34/.tox/py34/lib/python3.4/site-packages/testtools/testcase.py", line 404, in assertThat
2015-07-15 19:57:57.944 | mismatch_error = self._matchHelper(matchee, matcher, message, verbose)
2015-07-15 19:57:57.944 | File "/home/jenkins/workspace/gate-sqlalchemy-migrate-python34/.tox/py34/lib/python3.4/site-packages/testtools/testcase.py", line 454, in _matchHelper
2015-07-15 19:57:57.944 | mismatch = matcher.match(matchee)
2015-07-15 19:57:57.944 | File "/home/jenkins/workspace/gate-sqlalchemy-migrate-python34/.tox/py34/lib/python3.4/site-packages/testtools/matchers/_exception.py", line 108, in match
2015-07-15 19:57:57.945 | mismatch = self.exception_matcher.match(exc_info)
2015-07-15 19:57:57.945 | File "/home/jenkins/workspace/gate-sqlalchemy-migrate-python34/.tox/py34/lib/python3.4/site-packages/testtools/matchers/_higherorder.py", line 62, in match
2015-07-15 19:57:57.945 | mismatch = matcher.match(matchee)
2015-07-15 19:57:57.945 | File "/home/jenkins/workspace/gate-sqlalchemy-migrate-python34/.tox/py34/lib/python3.4/site-packages/testtools/testcase.py", line 385, in match
2015-07-15 19:57:57.945 | reraise(*matchee)
2015-07-15 19:57:57.945 | File "/home/jenkins/workspace/gate-sqlalchemy-migrate-python34/.tox/py34/lib/python3.4/site-packages/testtools/_compat3x.py", line 16, in reraise
2015-07-15 19:57:57.945 | raise exc_obj.with_traceback(exc_tb)
2015-07-15 19:57:57.945 | File "/home/jenkins/workspace/gate-sqlalchemy-migrate-python34/.tox/py34/lib/python3.4/site-packages/testtools/matchers/_exception.py", line 101, in match
2015-07-15 19:57:57.945 | result = matchee()
2015-07-15 19:57:57.945 | File "/home/jenkins/workspace/gate-sqlalchemy-migrate-python34/.tox/py34/lib/python3.4/site-packages/testtools/testcase.py", line 902, in __call__
2015-07-15 19:57:57.945 | return self._callable_object(*self._args, **self._kwargs)
2015-07-15 19:57:57.946 | File "/home/jenkins/workspace/gate-sqlalchemy-migrate-python34/migrate/versioning/script/py.py", line 97, in verify_module
2015-07-15 19:57:57.946 | module = import_path(path)
2015-07-15 19:57:57.946 | File "/home/jenkins/workspace/gate-sqlalchemy-migrate-python34/migrate/versioning/util/importpath.py", line 14, in import_path
2015-07-15 19:57:57.946 | module = __import__(filename)
2015-07-15 19:57:57.946 | ImportError: No module named 'xuqvbego'
2015-07-15 19:57:57.946 |

Revision history for this message
Matt Riedemann (mriedem) wrote :

Based on https://docs.python.org/3/library/functions.html#__import__ - maybe we should change that to importlib.import_module() and see if that helps. Otherwise we might just be catching the wrong exception.

Revision history for this message
Matt Riedemann (mriedem) wrote :

This is what alembic does to handle import compat weirdness with different python versions:

https://bitbucket.org/zzzeek/alembic/src/c1947910621ad283219c2730d9224644e51a816c/alembic/util/compat.py?at=master#cl-63

Changed in sqlalchemy-migrate:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Matt Riedemann (mriedem) wrote :
Changed in sqlalchemy-migrate:
status: Confirmed → In Progress
assignee: nobody → Matt Riedemann (mriedem)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to sqlalchemy-migrate (master)

Reviewed: https://review.openstack.org/202170
Committed: https://git.openstack.org/cgit/stackforge/sqlalchemy-migrate/commit/?id=8252703f56d394743199e702c38f1ecc1db590e5
Submitter: Jenkins
Branch: master

commit 8252703f56d394743199e702c38f1ecc1db590e5
Author: Matt Riedemann <email address hidden>
Date: Wed Jul 15 09:02:50 2015 -0700

    Unblock migrate (py26 and py3* testing issues)

    There are two changes which have to go together to pass the gate
    tests:

    1. Update pbr and mock requirements from global-requirements

    mock 1.2 supports py26 again so make that the minimum version. The
    same change is being made in g-r with:

    Ic6b9e18eaec9c81bbbbc57129e024904be928e09

    Sync up with latest pbr in global-requirements while we're at it.

    Closes-Bug: #1474925

    2. Fix the importpath module to work with python >= 3.3 where the
    __import__ built-in is raising an ImportError on a temporary file
    that is added to the system path.

    Closes-Bug: #1475339

    Change-Id: Ie98938ba75f3983094dd540b7d26a7ec46be4f6e

Changed in sqlalchemy-migrate:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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