Skip to content

Commit

Permalink
gc.collect() before unlinking the db in some tests (more)
Browse files Browse the repository at this point in the history
  • Loading branch information
altendky authored Feb 28, 2023
1 parent c5d7339 commit 82b8c2c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions chia/simulator/setup_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ async def setup_full_node(
) -> AsyncGenerator[Service[FullNode], None]:
db_path = local_bt.root_path / f"{db_name}"
if db_path.exists():
# TODO: remove (maybe) when fixed https://github.com/python/cpython/issues/97641
gc.collect()
db_path.unlink()

if db_version > 1:
Expand Down Expand Up @@ -200,6 +202,8 @@ async def setup_wallet_node(
db_path = local_bt.root_path / db_path_replaced

if db_path.exists():
# TODO: remove (maybe) when fixed https://github.com/python/cpython/issues/97641
gc.collect()
db_path.unlink()
service_config["database_path"] = str(db_name)
service_config["testing"] = True
Expand Down Expand Up @@ -233,6 +237,8 @@ async def setup_wallet_node(
service.stop()
await service.wait_closed()
if db_path.exists():
# TODO: remove (maybe) when fixed https://github.com/python/cpython/issues/97641
gc.collect()
db_path.unlink()
keychain.delete_all_keys()

Expand Down

0 comments on commit 82b8c2c

Please sign in to comment.