Do not start nodes when deleting a project

Project.delete() calls open() to rebuild the internal data structures
needed for cleanup. open() schedules start_all() when the project has
auto_start enabled, so deleting an auto-start project actually launched
every node process, allocating ports and consuming resources, only for
close() to kill them moments later.

open() now takes an auto_start argument (default True, so normal opens
are unchanged) and delete() passes auto_start=False.

Fixes #2784
This commit is contained in:
Sanjay Santhanam committed 2026-07-25 20:00:43 -07:00
1 parent 6742d09a70
commit 00ac2c19bd
2 files changed
+19 -3

No files matched your search

+13
View File
@@ -655,6 +655,19 @@ async def test_delete(project):
assert not os.path.exists(project.path)
async def test_delete_does_not_start_nodes(project):
"""
Deleting a project must not start its nodes, even when auto_start is enabled.
"""
project.auto_start = True
project.dump()
await project.close()
project.start_all = AsyncioMagicMock()
await project.delete()
assert not project.start_all.called
async def test_dump(projects_dir):
directory = projects_dir