Skip to content

Commit

Permalink
Merge pull request #1767 from jecisc/improve-tests
Browse files Browse the repository at this point in the history
Avoid useless garbage collects
  • Loading branch information
MarcusDenker authored Nov 22, 2023
2 parents 83aea5c + a377d0d commit 7800508
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
9 changes: 6 additions & 3 deletions Iceberg-Tests/IceGitTestFactory.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,13 @@ IceGitTestFactory >> remoteFileUrl [

{ #category : 'initialization' }
IceGitTestFactory >> tearDownWithRepository: aRepository [

aRepository ifNotNil: [
aRepository free.
Smalltalk garbageCollect.
aRepository location ifNotNil: #ensureDeleteAll ].
[ aRepository location ifNotNil: #ensureDeleteAll ]
on: CannotDeleteFileException
do: [ "On windows it is possible we need to finalize everything before deleting the files. We do not do it directly to avoid to lose too much speed"
Smalltalk garbageCollect.
aRepository location ifNotNil: #ensureDeleteAll ] ].
self remoteFileUrl asFileReference ensureDeleteAll
]
7 changes: 5 additions & 2 deletions Iceberg-Tests/IceNotYetClonedRepositoryFixture.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ IceNotYetClonedRepositoryFixture >> setUp [
{ #category : 'running' }
IceNotYetClonedRepositoryFixture >> tearDown [

Smalltalk garbageCollect.
self location ifNotNil: #ensureDeleteAll.
[ self location ifNotNil: #ensureDeleteAll ]
on: CannotDeleteFileException
do: [ "On windows it is possible we need to finalize everything before deleting the files. We do not do it directly to avoid to lose too much speed"
Smalltalk garbageCollect.
self location ifNotNil: #ensureDeleteAll ]
]

0 comments on commit 7800508

Please sign in to comment.