Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear database state in the mock daemon after each lxdSuiteTest #3320

Conversation

freeekanayaka
Copy link
Contributor

@freeekanayaka freeekanayaka commented May 16, 2017

Currently unit tests based on lxdSuiteTest all share the same
database, meaning that state left by certain tests can influence other
tests (for instance it's not possible to create a pool with the same
name in two different tests).

This change resets the db state after each individual test run,
increasing isolation between tests.

Note that we need to reset the daemon config in-memory map because
it's a cache of the db state. I think there other cases of such caches, but
it should be fine to deal with them as we go. For now current tests are
happy with this change.

Signed-off-by: Free Ekanayaka [email protected]

Currently unit tests based on lxdSuiteTest all share the same
database, meaning that state left by certain tests can influence other
tests (for instance it's not possible to create a pool with the same
name in two different tests).

This change resets the db state after each individual test run,
increasing isolation between tests.

Signed-off-by: Free Ekanayaka <[email protected]>
@freeekanayaka freeekanayaka force-pushed the clear-db-state-after-each-test-using-lxdSuiteTest branch from 7c5c5ba to 4e42226 Compare May 16, 2017 09:01
@brauner brauner merged commit d50668c into canonical:master May 16, 2017
@freeekanayaka freeekanayaka deleted the clear-db-state-after-each-test-using-lxdSuiteTest branch May 16, 2017 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants