Skip to content

Commit 12ddc92

Browse files
authored
gc.collect() before unlinking the db in some tests (more) (#14702)
#14491 python/cpython#97641
1 parent c5d7339 commit 12ddc92

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

chia/simulator/setup_services.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ async def setup_full_node(
105105
) -> AsyncGenerator[Service[FullNode], None]:
106106
db_path = local_bt.root_path / f"{db_name}"
107107
if db_path.exists():
108+
# TODO: remove (maybe) when fixed https://github.com/python/cpython/issues/97641
109+
gc.collect()
108110
db_path.unlink()
109111

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

202204
if db_path.exists():
205+
# TODO: remove (maybe) when fixed https://github.com/python/cpython/issues/97641
206+
gc.collect()
203207
db_path.unlink()
204208
service_config["database_path"] = str(db_name)
205209
service_config["testing"] = True
@@ -233,6 +237,8 @@ async def setup_wallet_node(
233237
service.stop()
234238
await service.wait_closed()
235239
if db_path.exists():
240+
# TODO: remove (maybe) when fixed https://github.com/python/cpython/issues/97641
241+
gc.collect()
236242
db_path.unlink()
237243
keychain.delete_all_keys()
238244

0 commit comments

Comments
 (0)