mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 07:53:42 -05:00
Fix gc job leak in tests
This commit is contained in:
parent
b5e7327410
commit
b91390c025
1 changed files with 15 additions and 2 deletions
|
@ -1,5 +1,7 @@
|
||||||
package uk.ac.ic.wlgitbridge.bridge.gc;
|
package uk.ac.ic.wlgitbridge.bridge.gc;
|
||||||
|
|
||||||
|
import org.junit.After;
|
||||||
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.mockito.stubbing.OngoingStubbing;
|
import org.mockito.stubbing.OngoingStubbing;
|
||||||
import uk.ac.ic.wlgitbridge.bridge.lock.LockGuard;
|
import uk.ac.ic.wlgitbridge.bridge.lock.LockGuard;
|
||||||
|
@ -24,9 +26,20 @@ public class GcJobImplTest {
|
||||||
|
|
||||||
RepoStore repoStore = mock(RepoStore.class);
|
RepoStore repoStore = mock(RepoStore.class);
|
||||||
|
|
||||||
ProjectLock locks = new ProjectLockImpl();
|
ProjectLock locks;
|
||||||
|
|
||||||
GcJobImpl gcJob = new GcJobImpl(repoStore, locks, 5);
|
GcJobImpl gcJob;
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setup() {
|
||||||
|
locks = new ProjectLockImpl();
|
||||||
|
gcJob = new GcJobImpl(repoStore, locks, 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
@After
|
||||||
|
public void teardown() {
|
||||||
|
gcJob.stop();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void addedProjectsAreAllEventuallyGcedOnce() throws Exception {
|
public void addedProjectsAreAllEventuallyGcedOnce() throws Exception {
|
||||||
|
|
Loading…
Reference in a new issue