Skip to content

Commit

Permalink
win: GC after every TC to fixes appveyor hang runs
Browse files Browse the repository at this point in the history
+ Fixed the hangs at `test_git:TestGit.test_handle_process_output()`.
[travisci skip]
  • Loading branch information
ankostis committed Sep 25, 2016
1 parent 1210ec7 commit 8fe4fee
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions git/test/lib/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ def setUpClass(cls):
Dynamically add a read-only repository to our actual type. This way
each test type has its own repository
"""
import gc
gc.collect()
cls.rorepo = Repo(GIT_REPO)

@classmethod
Expand Down
4 changes: 4 additions & 0 deletions git/test/performance/test_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

class TestPerformance(TestBigRepoRW):

def tearDown(self):
import gc
gc.collect()

# ref with about 100 commits in its history
ref_100 = '0.1.6'

Expand Down
7 changes: 6 additions & 1 deletion git/test/test_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@


class Tutorials(TestBase):

def tearDown(self):
import gc
gc.collect()

@with_rw_directory
def test_init_repo_object(self, rw_dir):
# [1-test_init_repo_object]
Expand Down Expand Up @@ -64,7 +69,7 @@ def test_init_repo_object(self, rw_dir):
assert repo.head.ref == repo.heads.master # head is a symbolic reference pointing to master
assert repo.tags['0.3.5'] == repo.tag('refs/tags/0.3.5') # you can access tags in various ways too
assert repo.refs.master == repo.heads['master'] # .refs provides access to all refs, i.e. heads ...

if 'TRAVIS' not in os.environ:
assert repo.refs['origin/master'] == repo.remotes.origin.refs.master # ... remotes ...
assert repo.refs['0.3.5'] == repo.tags['0.3.5'] # ... and tags
Expand Down
4 changes: 4 additions & 0 deletions git/test/test_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ def setUpClass(cls):
super(TestGit, cls).setUpClass()
cls.git = Git(cls.rorepo.working_dir)

def tearDown(self):
import gc
gc.collect()

@patch.object(Git, 'execute')
def test_call_process_calls_execute(self, git):
git.return_value = ''
Expand Down

0 comments on commit 8fe4fee

Please sign in to comment.