Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbdb4c7c

Browse files
committed
fix(leaks, TCs): attempt to cleanup mman before deleting tmp-dirs
1 parentf1a82e4 commitbdb4c7c

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

‎git/test/lib/helper.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,22 @@
77

88
importcontextlib
99
fromfunctoolsimportwraps
10-
importsys
10+
importgc
1111
importio
1212
importlogging
1313
importos
14+
importsys
1415
importtempfile
1516
importtextwrap
1617
importtime
1718

1819
fromgit.compatimportstring_types,is_win
1920
fromgit.utilimportrmtree,cwd
21+
importgitdb
2022

2123
importos.pathasosp
24+
25+
2226
ifsys.version_info[0:2]== (2,6):
2327
importunittest2asunittest
2428
else:
@@ -96,7 +100,6 @@ def wrapper(self):
96100
# a windows-only issue. In fact things should be deleted, as well as
97101
# memory maps closed, once objects go out of scope. For some reason
98102
# though this is not the case here unless we collect explicitly.
99-
importgc
100103
gc.collect()
101104
ifnotkeep:
102105
rmtree(path)
@@ -144,9 +147,10 @@ def repo_creator(self):
144147
os.chdir(prev_cwd)
145148
rw_repo.git.clear_cache()
146149
rw_repo=None
147-
importgc
148-
gc.collect()
149150
ifrepo_dirisnotNone:
151+
gc.collect()
152+
gitdb.util.mman.collect()
153+
gc.collect()
150154
rmtree(repo_dir)
151155
# END rm test repo if possible
152156
# END cleanup
@@ -303,7 +307,8 @@ def remote_repo_creator(self):
303307
rw_daemon_repo.git.clear_cache()
304308
delrw_repo
305309
delrw_daemon_repo
306-
importgc
310+
gc.collect()
311+
gitdb.util.mman.collect()
307312
gc.collect()
308313
ifrw_repo_dir:
309314
rmtree(rw_repo_dir)
@@ -357,7 +362,6 @@ def setUpClass(cls):
357362
each test type has its own repository
358363
"""
359364
fromgitimportRepo
360-
importgc
361365
gc.collect()
362366
cls.rorepo=Repo(GIT_REPO)
363367

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp