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

cleanup sqlitedb temporary db file after tests #1607

Merged
merged 2 commits into from Apr 16, 2012

Conversation

minrk
Copy link
Member

@minrk minrk commented Apr 15, 2012

Avoids

...
[Application] Table _ exists and doesn't match db format, trying __1
[Application] keys mismatch

messages in the test suite, which could happen if the test suite was run in relatively quick succession across db-format changes.

@fperez
Copy link
Member

fperez commented Apr 16, 2012

Wouldn't it be better for that file to be created with tempfile instead of having a fixed 'tasks.db' name? That way, a stray /tmp/tasks.db file can't cause problems. A scenario where that could occur: user 1 runs the suite before this cleanup fix or with a crash that for some reason prevents cleanup, then user 2 on the same machine can't run the tests anymore because he can't create/write to /tmp/tasks.db. Making that filename with the tempfile machinery will prevent this, it can be simply a module-level global created in setup() and deleted in teardown() just like now, but with a random name made by tempfile.

@minrk
Copy link
Member Author

minrk commented Apr 16, 2012

Sensible, I'll write that up now.

@fperez
Copy link
Member

fperez commented Apr 16, 2012

Awesome, thx. I'll review and merge quickly.

avoids potential conflict with simultaneous test runs

per review by @fperez
@minrk
Copy link
Member Author

minrk commented Apr 16, 2012

setup() now creates full temp file.

@fperez
Copy link
Member

fperez commented Apr 16, 2012

Perfect, thanks! Merging now.

fperez added a commit that referenced this pull request Apr 16, 2012
cleanup sqlitedb temporary db file after tests, and make the temp db file have a random name to avoid possible collisions with simultaneous test runs.
@fperez fperez merged commit f57191a into ipython:master Apr 16, 2012
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
cleanup sqlitedb temporary db file after tests, and make the temp db file have a random name to avoid possible collisions with simultaneous test runs.
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.

None yet

2 participants