summaryrefslogtreecommitdiffstats
path: root/configserver
diff options
context:
space:
mode:
authorHarald Musum <musum@verizonmedia.com>2020-05-28 15:09:18 +0200
committerHarald Musum <musum@verizonmedia.com>2020-05-28 15:09:18 +0200
commit204834dca35a0bea619c1211a4bb09a472f18fa7 (patch)
tree16e19bef5ea73c98e08ebc61c7640480863a932c /configserver
parent13d1a3491b1daac7a6058300e83014200e30386c (diff)
Refactoring
* Remove flag source from SessionContext, not needed * Minror refactoring to make code clearer in SessionFactoryImpl
Diffstat (limited to 'configserver')
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java6
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionContext.java8
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionFactoryImpl.java64
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionPreparer.java4
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionZooKeeperClient.java2
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java1
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRequestHandler.java6
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/http/SessionHandlerTest.java9
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionActiveHandlerTest.java12
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionPrepareHandlerTest.java3
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/session/LocalSessionTest.java5
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/session/SessionPreparerTest.java3
12 files changed, 54 insertions, 69 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java b/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java
index 051a2b13d38..73c8521d963 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java
@@ -670,10 +670,8 @@ public class ApplicationRepository implements com.yahoo.config.provision.Deploye
public long createSession(ApplicationId applicationId, TimeoutBudget timeoutBudget, File applicationDirectory) {
Tenant tenant = tenantRepository.getTenant(applicationId.tenant());
tenant.getApplicationRepo().createApplication(applicationId);
- LocalSessionRepo localSessionRepo = tenant.getLocalSessionRepo();
- SessionFactory sessionFactory = tenant.getSessionFactory();
- LocalSession session = sessionFactory.createSession(applicationDirectory, applicationId, timeoutBudget);
- localSessionRepo.addSession(session);
+ LocalSession session = tenant.getSessionFactory().createSession(applicationDirectory, applicationId, timeoutBudget);
+ tenant.getLocalSessionRepo().addSession(session);
return session.getSessionId();
}
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionContext.java b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionContext.java
index 0495a51514c..0c430780aad 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionContext.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionContext.java
@@ -22,18 +22,15 @@ public class SessionContext {
private final File serverDBSessionDir;
private final TenantApplications applicationRepo;
private final HostValidator<ApplicationId> hostRegistry;
- private final FlagSource flagSource;
public SessionContext(ApplicationPackage applicationPackage, SessionZooKeeperClient sessionZooKeeperClient,
File serverDBSessionDir, TenantApplications applicationRepo,
- HostValidator<ApplicationId> hostRegistry,
- FlagSource flagSource) {
+ HostValidator<ApplicationId> hostRegistry) {
this.applicationPackage = applicationPackage;
this.sessionZooKeeperClient = sessionZooKeeperClient;
this.serverDBSessionDir = serverDBSessionDir;
this.applicationRepo = applicationRepo;
this.hostRegistry = hostRegistry;
- this.flagSource = flagSource;
}
public ApplicationPackage getApplicationPackage() {
@@ -54,7 +51,4 @@ public class SessionContext {
public HostValidator<ApplicationId> getHostValidator() { return hostRegistry; }
- public FlagSource getFlagSource() {
- return flagSource;
- }
}
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionFactoryImpl.java b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionFactoryImpl.java
index 5397ad30fdc..aa3e1921efc 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionFactoryImpl.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionFactoryImpl.java
@@ -8,9 +8,10 @@ import com.yahoo.config.provision.NodeFlavors;
import com.yahoo.io.IOUtils;
import java.util.logging.Level;
import com.yahoo.path.Path;
-import com.yahoo.vespa.config.server.*;
import com.yahoo.config.provision.ApplicationId;
import com.yahoo.config.provision.TenantName;
+import com.yahoo.vespa.config.server.GlobalComponentRegistry;
+import com.yahoo.vespa.config.server.TimeoutBudget;
import com.yahoo.vespa.config.server.application.TenantApplications;
import com.yahoo.vespa.config.server.deploy.TenantFileSystemDirs;
import com.yahoo.vespa.config.server.host.HostValidator;
@@ -42,10 +43,9 @@ public class SessionFactoryImpl implements SessionFactory, LocalSessionLoader {
private final SessionPreparer sessionPreparer;
private final Curator curator;
private final ConfigCurator configCurator;
- private final SessionCounter sessionCounter;
private final TenantApplications applicationRepo;
private final Path sessionsPath;
- private final TenantFileSystemDirs tenantFileSystemDirs;
+ private final GlobalComponentRegistry componentRegistry;
private final HostValidator<ApplicationId> hostRegistry;
private final TenantName tenant;
private final String serverId;
@@ -63,10 +63,9 @@ public class SessionFactoryImpl implements SessionFactory, LocalSessionLoader {
this.sessionPreparer = globalComponentRegistry.getSessionPreparer();
this.curator = globalComponentRegistry.getCurator();
this.configCurator = globalComponentRegistry.getConfigCurator();
- this.sessionCounter = new SessionCounter(globalComponentRegistry.getConfigCurator(), tenant);
this.sessionsPath = TenantRepository.getSessionsPath(tenant);
this.applicationRepo = applicationRepo;
- this.tenantFileSystemDirs = new TenantFileSystemDirs(globalComponentRegistry.getConfigServerDB(), tenant);
+ this.componentRegistry = globalComponentRegistry;
this.serverId = globalComponentRegistry.getConfigserverConfig().serverId();
this.nodeFlavors = globalComponentRegistry.getZone().nodeFlavors();
this.clock = globalComponentRegistry.getClock();
@@ -76,13 +75,12 @@ public class SessionFactoryImpl implements SessionFactory, LocalSessionLoader {
/** Create a session for a true application package change */
@Override
- public LocalSession createSession(File applicationFile,
- ApplicationId applicationId,
- TimeoutBudget timeoutBudget) {
+ public LocalSession createSession(File applicationFile, ApplicationId applicationId, TimeoutBudget timeoutBudget) {
return create(applicationFile, applicationId, nonExistingActiveSession, false, timeoutBudget);
}
- private void ensureZKPathDoesNotExist(Path sessionPath) {
+ private void ensureSessionPathDoesNotExist(long sessionId) {
+ Path sessionPath = getSessionPath(sessionId);
if (configCurator.exists(sessionPath.getAbsolute())) {
throw new IllegalArgumentException("Path " + sessionPath.getAbsolute() + " already exists in ZooKeeper");
}
@@ -110,14 +108,10 @@ public class SessionFactoryImpl implements SessionFactory, LocalSessionLoader {
Clock clock) {
log.log(Level.FINE, TenantRepository.logPre(tenant) + "Creating session " + sessionId + " in ZooKeeper");
sessionZKClient.createNewSession(clock.instant());
- log.log(Level.FINE, TenantRepository.logPre(tenant) + "Creating upload waiter for session " + sessionId);
Curator.CompletionWaiter waiter = sessionZKClient.getUploadWaiter();
- log.log(Level.FINE, TenantRepository.logPre(tenant) + "Done creating upload waiter for session " + sessionId);
- SessionContext context = new SessionContext(applicationPackage, sessionZKClient, getSessionAppDir(sessionId), applicationRepo, hostRegistry, flagSource);
+ SessionContext context = createSessionContext(applicationPackage, sessionZKClient, getSessionAppDir(sessionId));
LocalSession session = new LocalSession(tenant, sessionId, sessionPreparer, context);
- log.log(Level.FINE, TenantRepository.logPre(tenant) + "Waiting on upload waiter for session " + sessionId);
waiter.awaitCompletion(timeoutBudget.timeLeft());
- log.log(Level.FINE, TenantRepository.logPre(tenant) + "Done waiting on upload waiter for session " + sessionId);
return session;
}
@@ -145,16 +139,12 @@ public class SessionFactoryImpl implements SessionFactory, LocalSessionLoader {
private LocalSession create(File applicationFile, ApplicationId applicationId, long currentlyActiveSessionId,
boolean internalRedeploy, TimeoutBudget timeoutBudget) {
- long sessionId = sessionCounter.nextSessionId();
- Path sessionIdPath = sessionsPath.append(String.valueOf(sessionId));
+ long sessionId = getNextSessionId();
try {
- ensureZKPathDoesNotExist(sessionIdPath);
- SessionZooKeeperClient sessionZooKeeperClient = new SessionZooKeeperClient(curator,
- configCurator,
- sessionIdPath,
- serverId,
- nodeFlavors);
- File userApplicationDir = tenantFileSystemDirs.getUserApplicationDir(sessionId);
+ ensureSessionPathDoesNotExist(sessionId);
+ SessionZooKeeperClient sessionZooKeeperClient =
+ new SessionZooKeeperClient(curator, configCurator, getSessionPath(sessionId), serverId, nodeFlavors);
+ File userApplicationDir = getSessionAppDir(sessionId);
IOUtils.copyDirectory(applicationFile, userApplicationDir);
ApplicationPackage applicationPackage = createApplication(applicationFile,
userApplicationDir,
@@ -165,21 +155,25 @@ public class SessionFactoryImpl implements SessionFactory, LocalSessionLoader {
applicationPackage.writeMetaData();
return createSessionFromApplication(applicationPackage, sessionId, sessionZooKeeperClient, timeoutBudget, clock);
} catch (Exception e) {
- throw new RuntimeException("Error creating session " + sessionIdPath, e);
+ throw new RuntimeException("Error creating session " + sessionId, e);
}
}
- private File getSessionAppDir(long sessionId) {
- File appDir = tenantFileSystemDirs.getUserApplicationDir(sessionId);
+ private File getAndValidateExistingSessionAppDir(long sessionId) {
+ File appDir = getSessionAppDir(sessionId);
if (!appDir.exists() || !appDir.isDirectory()) {
throw new IllegalArgumentException("Unable to find correct application directory for session " + sessionId);
}
return appDir;
}
+ private File getSessionAppDir(long sessionId) {
+ return new TenantFileSystemDirs(componentRegistry.getConfigServerDB(), tenant).getUserApplicationDir(sessionId);
+ }
+
@Override
public LocalSession loadSession(long sessionId) {
- File sessionDir = getSessionAppDir(sessionId);
+ File sessionDir = getAndValidateExistingSessionAppDir(sessionId);
ApplicationPackage applicationPackage = FilesApplicationPackage.fromFile(sessionDir);
Path sessionIdPath = sessionsPath.append(String.valueOf(sessionId));
SessionZooKeeperClient sessionZKClient = new SessionZooKeeperClient(curator,
@@ -187,8 +181,7 @@ public class SessionFactoryImpl implements SessionFactory, LocalSessionLoader {
sessionIdPath,
serverId,
nodeFlavors);
- SessionContext context = new SessionContext(applicationPackage, sessionZKClient, sessionDir, applicationRepo,
- hostRegistry, flagSource);
+ SessionContext context = createSessionContext(applicationPackage, sessionZKClient, sessionDir);
return new LocalSession(tenant, sessionId, sessionPreparer, context);
}
@@ -200,4 +193,17 @@ public class SessionFactoryImpl implements SessionFactory, LocalSessionLoader {
return nonExistingActiveSession;
}
+ long getNextSessionId() {
+ return new SessionCounter(componentRegistry.getConfigCurator(), tenant).nextSessionId();
+ }
+
+ Path getSessionPath(long sessionId) {
+ return sessionsPath.append(String.valueOf(sessionId));
+ }
+
+ private SessionContext createSessionContext(ApplicationPackage applicationPackage,
+ SessionZooKeeperClient sessionZKClient, File sessionAppDir) {
+ return new SessionContext(applicationPackage, sessionZKClient, sessionAppDir, applicationRepo, hostRegistry);
+ }
+
}
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionPreparer.java b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionPreparer.java
index e6dbae5a421..c5c13bff5ec 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionPreparer.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionPreparer.java
@@ -80,6 +80,7 @@ public class SessionPreparer {
private final Zone zone;
private final SecretStore secretStore;
private final BooleanFlag distributeApplicationPackage;
+ private final FlagSource flagSource;
@Inject
public SessionPreparer(ModelFactoryRegistry modelFactoryRegistry,
@@ -102,6 +103,7 @@ public class SessionPreparer {
this.zone = zone;
this.secretStore = secretStore;
this.distributeApplicationPackage = Flags.CONFIGSERVER_DISTRIBUTE_APPLICATION_PACKAGE.bindTo(flagSource);
+ this.flagSource = flagSource;
}
/**
@@ -210,7 +212,7 @@ public class SessionPreparer {
Set.copyOf(containerEndpoints),
params.isBootstrap(),
currentActiveApplicationSet.isEmpty(),
- context.getFlagSource(),
+ flagSource,
endpointCertificateSecrets,
athenzDomain, applicationRoles);
this.fileDistributionProvider = fileDistributionFactory.createProvider(context.getServerDBSessionDir());
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionZooKeeperClient.java b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionZooKeeperClient.java
index 31a1ff7f668..33001d2996c 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionZooKeeperClient.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionZooKeeperClient.java
@@ -56,7 +56,7 @@ public class SessionZooKeeperClient {
// Only for testing when cache loader does not need cache entries.
public SessionZooKeeperClient(Curator curator, Path sessionPath) {
- this(curator, ConfigCurator.create(curator), sessionPath, "", Optional.empty());
+ this(curator, ConfigCurator.create(curator), sessionPath, "1", Optional.empty());
}
public SessionZooKeeperClient(Curator curator,
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java b/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java
index 04deed40c54..0ae5ca86215 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java
@@ -35,7 +35,6 @@ import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
-import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRequestHandler.java b/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRequestHandler.java
index 1fb09b993fb..25d6f194fdc 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRequestHandler.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRequestHandler.java
@@ -2,11 +2,9 @@
package com.yahoo.vespa.config.server.tenant;
import com.yahoo.component.Version;
-import com.yahoo.concurrent.StripedExecutor;
import com.yahoo.config.FileReference;
import com.yahoo.config.provision.ApplicationId;
import com.yahoo.config.provision.TenantName;
-import java.util.logging.Level;
import com.yahoo.vespa.config.ConfigKey;
import com.yahoo.vespa.config.GetConfigRequest;
import com.yahoo.vespa.config.protocol.ConfigResponse;
@@ -20,13 +18,11 @@ import com.yahoo.vespa.config.server.application.ApplicationMapper;
import com.yahoo.vespa.config.server.application.ApplicationSet;
import com.yahoo.vespa.config.server.application.TenantApplications;
import com.yahoo.vespa.config.server.application.VersionDoesNotExistException;
-import com.yahoo.vespa.config.server.host.HostRegistries;
import com.yahoo.vespa.config.server.host.HostRegistry;
import com.yahoo.vespa.config.server.host.HostValidator;
import com.yahoo.vespa.config.server.monitoring.MetricUpdater;
import com.yahoo.vespa.config.server.monitoring.Metrics;
import com.yahoo.vespa.config.server.rpc.ConfigResponseFactory;
-import com.yahoo.vespa.curator.Curator;
import com.yahoo.vespa.curator.Lock;
import java.time.Clock;
@@ -35,7 +31,7 @@ import java.util.LinkedHashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
-import java.util.concurrent.ExecutorService;
+import java.util.logging.Level;
import static java.util.stream.Collectors.toSet;
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/http/SessionHandlerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/http/SessionHandlerTest.java
index ed4ed1890d7..29fa74e756f 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/http/SessionHandlerTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/http/SessionHandlerTest.java
@@ -31,7 +31,6 @@ import com.yahoo.vespa.config.server.session.PrepareParams;
import com.yahoo.vespa.config.server.session.Session;
import com.yahoo.vespa.config.server.session.SessionContext;
import com.yahoo.vespa.config.server.session.SessionFactory;
-import com.yahoo.vespa.flags.InMemoryFlagSource;
import java.io.ByteArrayOutputStream;
import java.io.File;
@@ -106,12 +105,8 @@ public class SessionHandlerTest {
private ApplicationId applicationId;
private Optional<DockerImage> dockerImageRepository;
- public MockSession(long id, ApplicationPackage app) {
- this(id, app, new InMemoryFlagSource());
- }
-
- private MockSession(long id, ApplicationPackage app, InMemoryFlagSource flagSource) {
- super(TenantName.defaultName(), id, null, new SessionContext(app, new MockSessionZKClient(app), null, null, new HostRegistry<>(), flagSource));
+ public MockSession(long sessionId, ApplicationPackage app) {
+ super(TenantName.defaultName(), sessionId, null, new SessionContext(app, new MockSessionZKClient(app), null, null, new HostRegistry<>()));
}
public MockSession(long sessionId, ApplicationPackage applicationPackage, ConfigChangeActions actions) {
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionActiveHandlerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionActiveHandlerTest.java
index 7a76b70dc27..bb1acce3c60 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionActiveHandlerTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionActiveHandlerTest.java
@@ -8,9 +8,9 @@ import com.yahoo.config.model.application.provider.BaseDeployLogger;
import com.yahoo.config.model.application.provider.DeployData;
import com.yahoo.config.model.application.provider.FilesApplicationPackage;
import com.yahoo.config.model.application.provider.MockFileRegistry;
+import com.yahoo.config.provision.AllocatedHosts;
import com.yahoo.config.provision.ApplicationId;
import com.yahoo.config.provision.HostSpec;
-import com.yahoo.config.provision.AllocatedHosts;
import com.yahoo.config.provision.TenantName;
import com.yahoo.config.provision.Zone;
import com.yahoo.container.jdisc.HttpResponse;
@@ -42,7 +42,6 @@ import com.yahoo.vespa.config.server.tenant.TenantBuilder;
import com.yahoo.vespa.config.server.tenant.TenantRepository;
import com.yahoo.vespa.curator.Curator;
import com.yahoo.vespa.curator.mock.MockCurator;
-import com.yahoo.vespa.flags.InMemoryFlagSource;
import com.yahoo.vespa.model.VespaModelFactory;
import org.hamcrest.core.Is;
import org.junit.Before;
@@ -67,7 +66,10 @@ import static com.yahoo.jdisc.Response.Status.OK;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
public class SessionActiveHandlerTest extends SessionHandlerTest {
@@ -76,7 +78,6 @@ public class SessionActiveHandlerTest extends SessionHandlerTest {
private static final TenantName tenantName = TenantName.from("activatetest");
private static final String activatedMessage = " for tenant '" + tenantName + "' activated.";
- private final InMemoryFlagSource flagSource = new InMemoryFlagSource();
private Curator curator;
private LocalSessionRepo localRepo;
private TenantApplications applicationRepo;
@@ -222,8 +223,7 @@ public class SessionActiveHandlerTest extends SessionHandlerTest {
ApplicationPackage app = FilesApplicationPackage.fromFileWithDeployData(testApp, deployData);
localRepo.addSession(new LocalSession(tenantName, sessionId, new SessionTest.MockSessionPreparer(),
new SessionContext(app, zkc, new File(tenantFileSystemDirs.sessionsPath(), String.valueOf(sessionId)),
- applicationRepo, new HostRegistry<>(),
- flagSource)));
+ applicationRepo, new HostRegistry<>())));
}
private ActivateRequest activateAndAssertOKPut(long sessionId, long previousSessionId, String subPath) throws Exception {
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionPrepareHandlerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionPrepareHandlerTest.java
index 0046c37f7c8..be3c9d6dcd1 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionPrepareHandlerTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/SessionPrepareHandlerTest.java
@@ -384,8 +384,7 @@ public class SessionPrepareHandlerTest extends SessionHandlerTest {
new MockSessionZKClient(MockApplicationPackage.createEmpty()),
null,
null,
- new HostRegistry<>(),
- null));
+ new HostRegistry<>()));
this.exception = exception;
}
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/session/LocalSessionTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/session/LocalSessionTest.java
index e98bf792e8b..8bf141e75c6 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/session/LocalSessionTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/session/LocalSessionTest.java
@@ -23,7 +23,6 @@ import com.yahoo.vespa.config.server.tenant.TenantRepository;
import com.yahoo.vespa.config.server.zookeeper.ConfigCurator;
import com.yahoo.vespa.curator.Curator;
import com.yahoo.vespa.curator.mock.MockCurator;
-import com.yahoo.vespa.flags.InMemoryFlagSource;
import org.junit.Before;
import org.junit.Test;
@@ -46,7 +45,6 @@ public class LocalSessionTest {
private static final File testApp = new File("src/test/apps/app");
- private final InMemoryFlagSource flagSource = new InMemoryFlagSource();
private Path tenantPath = Path.createRoot();
private Curator curator;
private ConfigCurator configCurator;
@@ -145,8 +143,7 @@ public class LocalSessionTest {
zkc,
sessionDir,
applications,
- new HostRegistry<>(),
- flagSource));
+ new HostRegistry<>()));
}
private void doPrepare(LocalSession session) {
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/session/SessionPreparerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/session/SessionPreparerTest.java
index d55bb35bfde..6e1e5963da7 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/session/SessionPreparerTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/session/SessionPreparerTest.java
@@ -333,8 +333,7 @@ public class SessionPreparerTest {
new SessionZooKeeperClient(curator, sessionsPath),
app.getAppDir(),
TenantApplications.create(componentRegistry, new MockReloadHandler(), TenantName.from("tenant")),
- new HostRegistry<>(),
- flagSource);
+ new HostRegistry<>());
}
private FilesApplicationPackage getApplicationPackage(File testFile) throws IOException {