oslo.db tries to delete non-existent databases before tests
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo-incubator |
Fix Released
|
Low
|
Angus Lees |
Bug Description
1. The database name is a random string, so shouldn't already exist.
2. If it *does* already exist, we quite likely want to throw an error
rather than just delete it.
3. "drop database if exists non_existant_
mysqlconnector and a noisy-but-harmless warning with others.
(We can fix the mysqlconnector error in (3), but it is minor compared to (1) and (2))
For reference, the error from (3) with mysqlconnector:
running=
Traceback (most recent call last):
File "/usr/lib/
"__main__", fname, loader, pkg_name)
File "/usr/lib/
exec code in run_globals
File
"<tox env>/oslo/
line 153, in <module>
main()
File
"<tox env>/oslo/
line 146, in main
print(
File
"<tox env>/oslo/
line 75, in create_database
_execute_
File
"<tox env>/oslo/
line 52, in _execute_sql
conn.execute(s)
File
"<tox env>/sqlalchemy
line 719, in execute
return self._execute_
File
"<tox env>/sqlalchemy
line 868, in _execute_text
statement, parameters
File
"<tox env>/sqlalchemy
line 954, in _execute_context
context)
File
"<tox env>/sqlalchemy
line 1116, in _handle_
exc_info
File
"<tox env>/sqlalchemy
line 189, in raise_from_cause
reraise(
File
"<tox env>/sqlalchemy
line 947, in _execute_context
context)
File
"<tox env>/sqlalchemy
line 435, in do_execute
cursor.
File
"<tox env>/mysql/
line 491, in execute
self.
File
"<tox env>/mysql/
line 419, in _handle_result
self.
File
"<tox env>/mysql/
line 389, in _handle_noresultset
self._warnings = self._fetch_
File
"<tox env>/mysql/
line 709, in _fetch_warnings
raise errors.
sqlalchemy.
'vgddrfgfsm'; database doesn't exist 'drop database if exists
vgddrfgfsm;' {}
Changed in oslo: | |
assignee: | nobody → Angus Lees (gus) |
status: | New → In Progress |
Changed in oslo: | |
importance: | Undecided → Low |
status: | In Progress → Triaged |
Changed in oslo: | |
status: | Triaged → In Progress |
tags: | added: db |
Changed in oslo: | |
milestone: | none → juno-2 |
status: | Fix Committed → Fix Released |
Reviewed: https:/ /review. openstack. org/104430 /git.openstack. org/cgit/ openstack/ oslo.db/ commit/ ?id=f817555c108 09f9708ea8d0a13 43cd0a5f709804
Committed: https:/
Submitter: Jenkins
Branch: master
commit f817555c10809f9 708ea8d0a1343cd 0a5f709804
Author: Angus Lees <email address hidden>
Date: Wed Jul 2 18:23:19 2014 +1000
Don't drop pre-existing database before tests
1. The database name is a random string, so shouldn't already exist. database" throws an error with
mysqlconnector and a noisy-but-harmless warning with others.
2. If it *does* already exist, we quite likely want to throw an error
rather than just delete it.
3. "drop database if exists non_existant_
(We could fix (3), if it was important)
For consistency, this also makes drop_database raise an error if the
database doesn't exist (or has been already deleted).
Closes-Bug: #1341906 eb79cbf8594d2ff 37fd70cf157
Change-Id: I0c4a460088ffb7