Repository navigation
tests: root temporary database and server directories under pytest tmp_path - #141
Merged
Merged
Conversation
…p_path A killed run never reaches fixture teardown, so the mkdtemp directories stayed in /tmp for good (48 arcadedb_test_db_* directories on 2026-10-25, each with a database.lck). pytest keeps only its last three basetemp runs, so directories made through tmp_path_factory are removed by the next runs. The explicit close and rmtree with the Windows retry stay. test_async_executor also leaked its mkdtemp parent on a normal exit; it now uses tmp_path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The temporary database and server-root fixtures now create their directories with pytest's
tmp_path_factory.mktemp(ortmp_path) instead oftempfile.mkdtemp. A killed run never reaches teardown, so the old directories stayed in/tmpfor good (48arcadedb_test_db_*directories on 2026-10-25). pytest keeps only its last three basetemp runs, so nothing permanent is left now.Changed:
temp_server_root,temp_db_path,temp_dbandtemp_dir_factoryintests/conftest.py; the module fixturedbintests/test_resultset_read_errors.py; thetemp_db_pathfixtures intests/test_import_database.pyandtests/test_exporter.py;cleanup_test_dirsintests/test_server_patterns.py;cleanup_dbintests/test_concurrency.py; thetmpfixture intests/test_free_threading.py; andtest_async_executor_sql_command_insert_is_exact_at_parallel_one, which also leaked itsmkdtempparent on a normal exit. The explicit close andrmtreewith the Windows retry stay, since pytest's cleanup is lazy and cannot retry a directory the JVM still holds.mktempis used rather than the per-testtmp_pathto keep the paths short on Windows.Left as is: the
__main__stress path intests/test_free_threading.py(a script, not a pytest fixture), the script strings run in a subprocess intests/test_java_package_shadowing.pyandtests/test_python_function_interrupt.py(no pytest fixtures there, and they remove their own directory), andtests/test_log_dir.py(it only readsgettempdir()to assert a default path). TheNamedTemporaryFilefiles intests/test_import_database.pyare single CSV or XML files, not databases.Checks:
pre-commit(black, isort) passes on the changed files and the files compile.pyflakesreports only the existing f-string warning intests/test_server_patterns.py, which is also on main. The suite was not run locally; CI covers it.Closes #140
🤖 Generated with Claude Code