feat(zygote): Django test database initialization before fork #88
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.
Summary
_setup_django_test_db()and_teardown_django_test_db()to Python harness--reuse-db/--create-dbCLI flags through env vars and Scheduler to TestPayloaddjango.test.utils.setup_databases()atexithandler for teardown; connections closed before forkCloses #84
What Changed
src/tach_harness.py_setup_django_test_db()+_teardown_django_test_db()+ global_DJANGO_OLD_CONFIGsrc/main.rsTACH_REUSE_DB/TACH_CREATE_DBenv vars before forksrc/execution/scheduler.rsreuse_db/create_dbfields, wire through to TestPayloadsrc/execution/zygote.rsensure_connection()warmup, add_setup_django_test_db()call afterinit_session()Design Decisions
setup_databases()is Python — harness owns the lifecycleTACH_NO_ISOLATIONpattern; Zygote inherits parent env before forkatexitfires when process exits_apply_django_db_isolation()Verification
cargo build✅cargo fmt✅cargo clippy -D warnings✅854/854 unit tests pass✅Summary by CodeRabbit
New Features
Bug Fixes