mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 08:55:44 +01:00
fix wrong ClassLoader for Delayed-Restart Thread, which has caused an ClassLoader leak.
Also added system properties to configure shutdown only, wait between stop and start and possibility to disable gc.
This commit is contained in:
@@ -18,11 +18,13 @@ class InjectionContextRestartStrategyTest {
|
||||
@Mock
|
||||
private RestartStrategy.InjectionContext context;
|
||||
|
||||
private InjectionContextRestartStrategy strategy = new InjectionContextRestartStrategy();
|
||||
private InjectionContextRestartStrategy strategy = new InjectionContextRestartStrategy(Thread.currentThread().getContextClassLoader());
|
||||
|
||||
@BeforeEach
|
||||
void setWaitToZero() {
|
||||
strategy.setWaitInMs(0L);
|
||||
// disable gc during tests
|
||||
strategy.setGcEnabled(false);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -47,7 +49,6 @@ class InjectionContextRestartStrategyTest {
|
||||
@Test
|
||||
void shouldRegisterContextAfterRestart() throws InterruptedException {
|
||||
TestingInjectionContext ctx = new TestingInjectionContext();
|
||||
|
||||
strategy.restart(ctx);
|
||||
|
||||
Thread.sleep(50L);
|
||||
|
||||
Reference in New Issue
Block a user