Interprocess file locks aren't usable in unit tests
Bug #1261728 reported by
Roman Podoliaka
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Base test case class has a fixture, that overrides CONF.lock_path value, which means that every test case will have CONF.lock_path set to its own temporary dir path. This makes interprocess locks unusable in unit tests, which is likely to break tests when they are run concurrently using testr (e.g. tests using MySQL/PostgreSQL might want to be run exclusively).
Changed in nova: | |
milestone: | none → icehouse-2 |
Changed in nova: | |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | icehouse-2 → 2014.1 |
To post a comment you must log in.
Reviewed: https:/ /review. openstack. org/62621 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=78d62186e5b 0388f740d42cb8d a5798cd67d7880
Committed: https:/
Submitter: Jenkins
Branch: master
commit 78d62186e5b0388 f740d42cb8da579 8cd67d7880
Author: Roman Podoliaka <email address hidden>
Date: Tue Dec 17 13:52:45 2013 +0200
Fix interprocess locks when running unit-tests
When running unit-tests concurrently using testr, we might
need to use interprocess file locks (e.g. for running various
tests using the same DB in MySQL/PostgreSQL).
At the same time file locks are only usable when they are placed
to one dir, and we have a test fixture that overrides the lock_path
config value for each test case with a new temporary directory.
The solution is to create the one temprorary directory for locks common. lockutils module, we just need to reuse
to be used by all tests before running tests and then remove it
after running tests. The corresponding helper has been already
put to openstack.
it properly, i.e. change the way unit tests are run in tox.ini.
Closes-Bug: #1261728
Change-Id: I76f95a9f7fdd31 c15e6cf4fd6316c 7569284f780