aboutsummaryrefslogtreecommitdiffstats
path: root/configserver
diff options
context:
space:
mode:
Diffstat (limited to 'configserver')
-rw-r--r--configserver/pom.xml32
-rw-r--r--configserver/src/main/java/com/fasterxml/jackson/jaxrs/json/package-info.java2
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/application/CompressedApplicationInputStream.java11
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileServer.java1
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationApiHandler.java18
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/maintenance/ApplicationPackageMaintainer.java1
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java2
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/zookeeper/ZKApplicationPackage.java6
-rw-r--r--configserver/src/test/apps/hosted-no-write-access-control/services.xml2
-rw-r--r--configserver/src/test/apps/hosted/services.xml2
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/ConfigServerBootstrapTest.java4
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/application/CompressedApplicationInputStreamTest.java29
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java2
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/deploy/HostedDeployTest.java36
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/maintenance/MaintainerTester.java2
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/model/LbServicesProducerTest.java5
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/tenant/TenantTest.java10
17 files changed, 59 insertions, 106 deletions
diff --git a/configserver/pom.xml b/configserver/pom.xml
index adb2541fb6f..86289a46d19 100644
--- a/configserver/pom.xml
+++ b/configserver/pom.xml
@@ -5,21 +5,22 @@
<parent>
<groupId>com.yahoo.vespa</groupId>
<artifactId>parent</artifactId>
- <version>7-SNAPSHOT</version>
+ <version>8-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<artifactId>configserver</artifactId>
<packaging>container-plugin</packaging>
- <version>7-SNAPSHOT</version>
+ <version>8-SNAPSHOT</version>
<dependencies>
<!-- BEGIN Jersey deps.
- TODO: remove after Vespa 8 is released, and provision-controller does not import any Jersey related packages.
- Also, remove all package-info.java files for jersey/jackson packages. -->
+ TODO: Vespa > 8, and provision-controller does not import any Jersey related packages:
+ Remove, and remove all package-info.java files for jersey/jackson packages. -->
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
+ <version>${jackson2.version}</version>
<exclusions>
<exclusion>
<!-- Conflicts with javax.activation:javax.activation-api:1.2.0, which is "exported" via jdisc_core. -->
@@ -41,10 +42,12 @@
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
+ <version>2.25</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
+ <version>2.25</version>
<exclusions>
<exclusion>
<groupId>org.glassfish.jersey.media</groupId>
@@ -55,10 +58,12 @@
<dependency>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>jersey-proxy-client</artifactId>
+ <version>2.25</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
+ <version>2.25</version>
<exclusions>
<!-- Prevent embedding deps provided by jdisc -->
<exclusion>
@@ -74,6 +79,7 @@
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-multipart</artifactId>
+ <version>2.25</version>
</dependency>
<!-- END Jersey deps -->
@@ -191,11 +197,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava-testlib</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>com.yahoo.vespa</groupId>
<artifactId>zkfacade</artifactId>
<version>${project.version}</version>
@@ -278,6 +279,17 @@
<artifactId>http-utils</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.lz4</groupId>
+ <artifactId>lz4-java</artifactId>
+ </dependency>
+ <dependency>
+ <!-- TODO Remove when Jetty is embedded inside container-core -->
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-http</artifactId>
+ <version>${jetty.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
@@ -287,7 +299,7 @@
<artifactId>bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
- <!-- TODO Vespa 8: remove importPackage when the jackson-jaxrs-json-provider bundle is no longer installed in jdisc -->
+ <!-- TODO: Vespa > 8: remove importPackage when the jackson-jaxrs-json-provider bundle is no longer installed in jdisc -->
<!-- added to ensure using the same class as orchestrator, core-dump-reporter, provision-controller and controller-clients -->
<importPackage>com.fasterxml.jackson.jaxrs.json;version="[2.12.6,3)"</importPackage>
</configuration>
diff --git a/configserver/src/main/java/com/fasterxml/jackson/jaxrs/json/package-info.java b/configserver/src/main/java/com/fasterxml/jackson/jaxrs/json/package-info.java
index 4ea1e169f0f..167995c832d 100644
--- a/configserver/src/main/java/com/fasterxml/jackson/jaxrs/json/package-info.java
+++ b/configserver/src/main/java/com/fasterxml/jackson/jaxrs/json/package-info.java
@@ -1,4 +1,4 @@
-@ExportPackage(version = @Version(major = 2, minor = 12, micro = 6))
+@ExportPackage(version = @Version(major = 2, minor = 13, micro = 3))
package com.fasterxml.jackson.jaxrs.json;
import com.yahoo.osgi.annotation.ExportPackage;
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/application/CompressedApplicationInputStream.java b/configserver/src/main/java/com/yahoo/vespa/config/server/application/CompressedApplicationInputStream.java
index 443ab47e786..1ac52213323 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/application/CompressedApplicationInputStream.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/application/CompressedApplicationInputStream.java
@@ -72,7 +72,6 @@ public class CompressedApplicationInputStream implements AutoCloseable {
public File decompress(File dir) throws IOException {
decompressInto(dir.toPath());
- dir = findActualApplicationDir(dir);
return dir;
}
@@ -109,14 +108,4 @@ public class CompressedApplicationInputStream implements AutoCloseable {
return Files.createTempFile(applicationDir, "application", null);
}
- private File findActualApplicationDir(File application) {
- // If application is in e.g. application/, use that as root for UnpackedApplication
- // TODO: Vespa 8: Remove application/ directory support
- File[] files = application.listFiles();
- if (files != null && files.length == 1 && files[0].isDirectory()) {
- application = files[0];
- }
- return application;
- }
-
}
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileServer.java b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileServer.java
index 15bd898c053..88405b3eef9 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileServer.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileServer.java
@@ -232,7 +232,6 @@ public class FileServer {
}
private static ConnectionPool createConnectionPool(List<String> configServers, Supervisor supervisor) {
- @SuppressWarnings("removal") // TODO Vespa 8: remove
ConfigSourceSet configSourceSet = new ConfigSourceSet(configServers);
if (configServers.size() == 0) return FileDownloader.emptyConnectionPool();
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationApiHandler.java b/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationApiHandler.java
index db3c8d0d165..b489eb70927 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationApiHandler.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationApiHandler.java
@@ -1,12 +1,14 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config.server.http.v2;
-import com.yahoo.component.annotation.Inject;
import com.yahoo.cloud.config.ConfigserverConfig;
+import com.yahoo.component.annotation.Inject;
import com.yahoo.config.provision.TenantName;
import com.yahoo.config.provision.Zone;
import com.yahoo.container.jdisc.HttpRequest;
import com.yahoo.container.jdisc.HttpResponse;
+import com.yahoo.container.jdisc.utils.MultiPartFormParser;
+import com.yahoo.container.jdisc.utils.MultiPartFormParser.PartItem;
import com.yahoo.jdisc.application.BindingMatch;
import com.yahoo.jdisc.http.HttpHeaders;
import com.yahoo.vespa.config.server.ApplicationRepository;
@@ -18,9 +20,7 @@ import com.yahoo.vespa.config.server.http.v2.response.SessionPrepareAndActivateR
import com.yahoo.vespa.config.server.session.PrepareParams;
import com.yahoo.vespa.config.server.tenant.TenantRepository;
import org.apache.hc.core5.http.ContentType;
-import org.eclipse.jetty.http.MultiPartFormInputStream;
-import javax.servlet.http.Part;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
@@ -28,7 +28,6 @@ import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.logging.Level;
-import java.util.stream.Collectors;
import static com.yahoo.vespa.config.server.application.CompressedApplicationInputStream.createFromCompressedStream;
import static com.yahoo.vespa.config.server.http.Utils.checkThatTenantExists;
@@ -80,15 +79,12 @@ public class ApplicationApiHandler extends SessionHandler {
.orElse(false);
if (multipartRequest) {
try {
- MultiPartFormInputStream multiPartFormInputStream = new MultiPartFormInputStream(request.getData(), request.getHeader(CONTENT_TYPE), /* config */null, /* contextTmpDir */null);
- Map<String, Part> parts = multiPartFormInputStream.getParts().stream()
- .collect(Collectors.toMap(Part::getName, p -> p));
-
- byte[] params = parts.get(MULTIPART_PARAMS).getInputStream().readAllBytes();
+ Map<String, PartItem> parts = new MultiPartFormParser(request).readParts();
+ byte[] params = parts.get(MULTIPART_PARAMS).data().readAllBytes();
log.log(Level.FINE, "Deploy parameters: [{0}]", new String(params, StandardCharsets.UTF_8));
prepareParams = PrepareParams.fromJson(params, tenantName, zookeeperBarrierTimeout);
- Part appPackagePart = parts.get(MULTIPART_APPLICATION_PACKAGE);
- compressedStream = createFromCompressedStream(appPackagePart.getInputStream(), appPackagePart.getContentType(), maxApplicationPackageSize);
+ PartItem appPackagePart = parts.get(MULTIPART_APPLICATION_PACKAGE);
+ compressedStream = createFromCompressedStream(appPackagePart.data(), appPackagePart.contentType(), maxApplicationPackageSize);
} catch (IOException e) {
log.log(Level.WARNING, "Unable to parse multipart in deploy", e);
throw new BadRequestException("Request contains invalid data");
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/maintenance/ApplicationPackageMaintainer.java b/configserver/src/main/java/com/yahoo/vespa/config/server/maintenance/ApplicationPackageMaintainer.java
index ccb17146df0..b2915bc74fb 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/maintenance/ApplicationPackageMaintainer.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/maintenance/ApplicationPackageMaintainer.java
@@ -96,7 +96,6 @@ public class ApplicationPackageMaintainer extends ConfigServerMaintainer {
File downloadDirectory,
Supervisor supervisor) {
List<String> otherConfigServersInCluster = getOtherConfigServersInCluster(configserverConfig);
- @SuppressWarnings("removal") // TODO Vespa 8: remove
ConfigSourceSet configSourceSet = new ConfigSourceSet(otherConfigServersInCluster);
ConnectionPool connectionPool = (otherConfigServersInCluster.isEmpty())
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java
index f572f241ce0..5603ef2df51 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java
@@ -782,7 +782,7 @@ public class SessionRepository {
}
}
- // TODO: Remove in Vespa 8 (when we don't allow files in SEARCH_DEFINITIONS_DIR)
+ // TODO: Remove on Vespa 9 (when we don't allow files in SEARCH_DEFINITIONS_DIR)
// Copies schemas from searchdefinitions/ to schemas/ if searchdefinitions/ exists
private void moveSearchDefinitionsToSchemasDir(java.nio.file.Path applicationDir) throws IOException {
File schemasDir = applicationDir.resolve(ApplicationPackage.SCHEMAS_DIR.getRelative()).toFile();
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/zookeeper/ZKApplicationPackage.java b/configserver/src/main/java/com/yahoo/vespa/config/server/zookeeper/ZKApplicationPackage.java
index 6a483c38aee..0fa6e9a0704 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/zookeeper/ZKApplicationPackage.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/zookeeper/ZKApplicationPackage.java
@@ -122,12 +122,6 @@ public class ZKApplicationPackage extends AbstractApplicationPackage {
}
@Override
- @SuppressWarnings("deprecation")
- public String getApplicationName() {
- return metaData.getApplicationId().application().value();
- }
-
- @Override
public ApplicationId getApplicationId() { return metaData.getApplicationId(); }
@Override
diff --git a/configserver/src/test/apps/hosted-no-write-access-control/services.xml b/configserver/src/test/apps/hosted-no-write-access-control/services.xml
index 9b36f71179b..578a1b02e8e 100644
--- a/configserver/src/test/apps/hosted-no-write-access-control/services.xml
+++ b/configserver/src/test/apps/hosted-no-write-access-control/services.xml
@@ -19,7 +19,7 @@
<documents>
<document type="music" mode="index" />
</documents>
- <nodes count="2" groups="2"/>
+ <nodes count="4" groups="2"/>
</content>
</services>
diff --git a/configserver/src/test/apps/hosted/services.xml b/configserver/src/test/apps/hosted/services.xml
index badd5f93c27..f1435d8cc4f 100644
--- a/configserver/src/test/apps/hosted/services.xml
+++ b/configserver/src/test/apps/hosted/services.xml
@@ -22,7 +22,7 @@
<documents>
<document type="music" mode="index" />
</documents>
- <nodes count="2" groups="2"/>
+ <nodes count="4" groups="2"/>
</content>
</services>
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/ConfigServerBootstrapTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/ConfigServerBootstrapTest.java
index c3baaf8b118..9a90d517ca5 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/ConfigServerBootstrapTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/ConfigServerBootstrapTest.java
@@ -66,7 +66,7 @@ public class ConfigServerBootstrapTest {
@Test
public void testBootstrap() throws Exception {
ConfigserverConfig configserverConfig = createConfigserverConfig(temporaryFolder);
- InMemoryProvisioner provisioner = new InMemoryProvisioner(7, false);
+ InMemoryProvisioner provisioner = new InMemoryProvisioner(9, false);
DeployTester tester = new DeployTester.Builder(temporaryFolder).modelFactory(createHostedModelFactory())
.configserverConfig(configserverConfig)
.hostProvisioner(provisioner).build();
@@ -104,7 +104,7 @@ public class ConfigServerBootstrapTest {
@Test
public void testBootstrapWithVipStatusFile() throws Exception {
ConfigserverConfig configserverConfig = createConfigserverConfig(temporaryFolder);
- InMemoryProvisioner provisioner = new InMemoryProvisioner(7, false);
+ InMemoryProvisioner provisioner = new InMemoryProvisioner(9, false);
DeployTester tester = new DeployTester.Builder(temporaryFolder).modelFactory(createHostedModelFactory())
.configserverConfig(configserverConfig).hostProvisioner(provisioner).build();
tester.deployApp("src/test/apps/hosted/");
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/application/CompressedApplicationInputStreamTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/application/CompressedApplicationInputStreamTest.java
index c7662ac9ee4..d3927309f65 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/application/CompressedApplicationInputStreamTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/application/CompressedApplicationInputStreamTest.java
@@ -77,35 +77,6 @@ public class CompressedApplicationInputStreamTest {
}
@Test
- public void require_that_valid_tar_application_in_subdir_can_be_unpacked() throws IOException {
- File outFile = Files.createTempFile(temporaryFolder.getRoot().toPath(), "testapp", ".tar.gz").toFile();
- ArchiveOutputStream archiveOutputStream = new TarArchiveOutputStream(new GZIPOutputStream(new FileOutputStream(outFile)));
-
- File app = new File("src/test/resources/deploy/validapp");
-
- File file = new File(app, "services.xml");
- archiveOutputStream.putArchiveEntry(archiveOutputStream.createArchiveEntry(file, "application/" + file.getName()));
- ByteStreams.copy(new FileInputStream(file), archiveOutputStream);
- archiveOutputStream.closeArchiveEntry();
- file = new File(app, "hosts.xml");
- archiveOutputStream.putArchiveEntry(archiveOutputStream.createArchiveEntry(file, "application/" + file.getName()));
- ByteStreams.copy(new FileInputStream(file), archiveOutputStream);
- archiveOutputStream.closeArchiveEntry();
- file = new File(app, "deployment.xml");
- archiveOutputStream.putArchiveEntry(archiveOutputStream.createArchiveEntry(file, "application/" + file.getName()));
- ByteStreams.copy(new FileInputStream(file), archiveOutputStream);
- archiveOutputStream.closeArchiveEntry();
-
- archiveOutputStream.close();
-
- try (CompressedApplicationInputStream unpacked = streamFromTarGz(outFile)) {
- File outApp = unpacked.decompress();
- assertEquals("application", outApp.getName()); // gets the name of the subdir
- assertTestApp(outApp);
- }
- }
-
- @Test
public void require_that_valid_zip_application_can_be_unpacked() throws IOException {
File outFile = createZipFile(temporaryFolder.getRoot().toPath());
try (CompressedApplicationInputStream unpacked = streamFromZip(outFile)) {
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java b/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java
index 9d01d56d72f..0ae4c43695c 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java
@@ -173,7 +173,7 @@ public class DeployTester {
}
private static HostProvisioner createProvisioner() {
- return new InMemoryProvisioner(7, false);
+ return new InMemoryProvisioner(9, false);
}
private static class FailingModelFactory implements ModelFactory {
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/HostedDeployTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/HostedDeployTest.java
index c58b550d660..10e3ab1ec97 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/HostedDeployTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/HostedDeployTest.java
@@ -165,7 +165,7 @@ public class HostedDeployTest {
.hostedConfigserverConfig(Zone.defaultZone())
.build();
tester.deployApp("src/test/apps/hosted/", "6.2.0");
- assertEquals(7, tester.getAllocatedHostsOf(tester.applicationId()).getHosts().size());
+ assertEquals(9, tester.getAllocatedHostsOf(tester.applicationId()).getHosts().size());
}
/**
@@ -174,7 +174,7 @@ public class HostedDeployTest {
*/
@Test
public void testCreateOnlyNeededModelVersions() {
- List<Host> hosts = createHosts(7, "6.0.0", "6.1.0", null, "6.1.0"); // Use a host without a version as well.
+ List<Host> hosts = createHosts(9, "6.0.0", "6.1.0", null, "6.1.0"); // Use a host without a version as well.
CountingModelFactory factory600 = createHostedModelFactory(Version.fromString("6.0.0"));
CountingModelFactory factory610 = createHostedModelFactory(Version.fromString("6.1.0"));
@@ -188,7 +188,7 @@ public class HostedDeployTest {
DeployTester tester = createTester(hosts, modelFactories, prodZone);
// Deploy with version that does not exist on hosts, the model for this version should also be created
tester.deployApp("src/test/apps/hosted/", "7.0.0");
- assertEquals(7, tester.getAllocatedHostsOf(tester.applicationId()).getHosts().size());
+ assertEquals(9, tester.getAllocatedHostsOf(tester.applicationId()).getHosts().size());
// Check >0 not ==0 as the session watcher thread is running and will redeploy models in the background
assertTrue(factory600.creationCount() > 0);
@@ -205,7 +205,7 @@ public class HostedDeployTest {
*/
@Test
public void testCreateOnlyNeededModelVersionsNewNodes() {
- List<Host> hosts = createHosts(7, (String) null);
+ List<Host> hosts = createHosts(9, (String) null);
CountingModelFactory factory600 = createHostedModelFactory(Version.fromString("6.0.0"));
CountingModelFactory factory610 = createHostedModelFactory(Version.fromString("6.1.0"));
@@ -216,7 +216,7 @@ public class HostedDeployTest {
DeployTester tester = createTester(hosts, modelFactories, prodZone);
// Deploy with version that does not exist on hosts, the model for this version should also be created
tester.deployApp("src/test/apps/hosted/", "7.0.0");
- assertEquals(7, tester.getAllocatedHostsOf(tester.applicationId()).getHosts().size());
+ assertEquals(9, tester.getAllocatedHostsOf(tester.applicationId()).getHosts().size());
// Check >0 not ==0 as the session watcher thread is running and will redeploy models in the background
assertTrue(factory700.creationCount() > 0);
@@ -229,7 +229,7 @@ public class HostedDeployTest {
*/
@Test
public void testCreateNeededModelVersionsForManuallyDeployedApps() {
- List<Host> hosts = createHosts(5, "7.0.0");
+ List<Host> hosts = createHosts(7, "7.0.0");
CountingModelFactory factory700 = createHostedModelFactory(Version.fromString("7.0.0"), devZone);
CountingModelFactory factory710 = createHostedModelFactory(Version.fromString("7.1.0"), devZone);
@@ -239,7 +239,7 @@ public class HostedDeployTest {
DeployTester tester = createTester(hosts, modelFactories, devZone);
// Deploy with version that does not exist on hosts, the model for this version should also be created
tester.deployApp("src/test/apps/hosted/", "7.2.0");
- assertEquals(5, tester.getAllocatedHostsOf(tester.applicationId()).getHosts().size());
+ assertEquals(7, tester.getAllocatedHostsOf(tester.applicationId()).getHosts().size());
// Check >0 not ==0 as the session watcher thread is running and will redeploy models in the background
// Nodes are on 7.0.0 (should be created), no nodes on 7.1.0 (should not be created), 7.2.0 should always be created
@@ -254,7 +254,7 @@ public class HostedDeployTest {
*/
@Test
public void testCreateModelVersionsForManuallyDeployedAppsWhenCreatingFailsForOneVersion() {
- List<Host> hosts = createHosts(5, "7.0.0");
+ List<Host> hosts = createHosts(7, "7.0.0");
ModelFactory factory700 = createFailingModelFactory(Version.fromString("7.0.0"));
CountingModelFactory factory720 = createHostedModelFactory(Version.fromString("7.2.0"), devZone);
@@ -264,7 +264,7 @@ public class HostedDeployTest {
// Deploy with version that does not exist on hosts, the model for this version should be created even
// if creating 7.0.0 fails
tester.deployApp("src/test/apps/hosted/", "7.2.0");
- assertEquals(5, tester.getAllocatedHostsOf(tester.applicationId()).getHosts().size());
+ assertEquals(7, tester.getAllocatedHostsOf(tester.applicationId()).getHosts().size());
// Check >0 not ==0 as the session watcher thread is running and will redeploy models in the background
assertTrue("Newest model for latest major version is always included", factory720.creationCount() > 0);
@@ -299,7 +299,7 @@ public class HostedDeployTest {
String oldestVersion = oldestMajorVersion + ".0.0";
String newestOnOldMajorVersion = oldestMajorVersion + ".1.0";
String newestOnNewMajorVersion = newestMajorVersion + ".2.0";
- List<Host> hosts = createHosts(7, oldestVersion, newestOnNewMajorVersion);
+ List<Host> hosts = createHosts(9, oldestVersion, newestOnNewMajorVersion);
CountingModelFactory factory1 = createHostedModelFactory(Version.fromString(oldestVersion));
CountingModelFactory factory2 = createHostedModelFactory(Version.fromString(newestOnOldMajorVersion));
@@ -308,7 +308,7 @@ public class HostedDeployTest {
DeployTester tester = createTester(hosts, modelFactories, prodZone);
tester.deployApp("src/test/apps/hosted/", oldestVersion);
- assertEquals(7, tester.getAllocatedHostsOf(tester.applicationId()).getHosts().size());
+ assertEquals(9, tester.getAllocatedHostsOf(tester.applicationId()).getHosts().size());
// Check >0 not ==0 as the session watcher thread is running and will redeploy models in the background
assertTrue(factory1.creationCount() > 0);
@@ -350,7 +350,7 @@ public class HostedDeployTest {
@Test
public void testAccessControlIsOnlyCheckedWhenNoProdDeploymentExists() {
// Provisioner does not reuse hosts, so need twice as many hosts as app requires
- List<Host> hosts = createHosts(14, "6.0.0");
+ List<Host> hosts = createHosts(18, "6.0.0");
List<ModelFactory> modelFactories = List.of(createHostedModelFactory(Version.fromString("6.0.0")),
createHostedModelFactory(Version.fromString("6.1.0")),
@@ -360,12 +360,12 @@ public class HostedDeployTest {
ApplicationId applicationId = tester.applicationId();
// Deploy with oldest version
tester.deployApp("src/test/apps/hosted/", "6.0.0");
- assertEquals(7, tester.getAllocatedHostsOf(applicationId).getHosts().size());
+ assertEquals(9, tester.getAllocatedHostsOf(applicationId).getHosts().size());
// Deploy with version that does not exist on hosts and with app package that has no write access control,
// validation of access control should not be done, since the app is already deployed in prod
tester.deployApp("src/test/apps/hosted-no-write-access-control", "6.1.0");
- assertEquals(7, tester.getAllocatedHostsOf(applicationId).getHosts().size());
+ assertEquals(9, tester.getAllocatedHostsOf(applicationId).getHosts().size());
}
@Test
@@ -408,7 +408,7 @@ public class HostedDeployTest {
@Test
public void testThatConfigChangeActionsAreCollectedFromAllModels() {
- List<Host> hosts = createHosts(7, "6.1.0", "6.2.0");
+ List<Host> hosts = createHosts(9, "6.1.0", "6.2.0");
List<ServiceInfo> services = List.of(
new ServiceInfo("serviceName", "serviceType", null, new HashMap<>(), "configId", "hostName"));
@@ -421,12 +421,12 @@ public class HostedDeployTest {
DeployTester tester = createTester(hosts, modelFactories, prodZone);
tester.deployApp("src/test/apps/hosted/", "6.2.0");
- assertEquals(7, tester.getAllocatedHostsOf(tester.applicationId()).getHosts().size());
+ assertEquals(9, tester.getAllocatedHostsOf(tester.applicationId()).getHosts().size());
}
@Test
public void testThatAllowedConfigChangeActionsAreActedUpon() {
- List<Host> hosts = createHosts(7, "6.1.0");
+ List<Host> hosts = createHosts(9, "6.1.0");
List<ServiceInfo> services = List.of(
new ServiceInfo("serviceName", "serviceType", null, Map.of("clustername", "cluster"), "configId", "hostName"));
@@ -447,7 +447,7 @@ public class HostedDeployTest {
.build();
PrepareResult prepareResult = tester.deployApp("src/test/apps/hosted/", "6.1.0");
- assertEquals(7, tester.getAllocatedHostsOf(tester.applicationId()).getHosts().size());
+ assertEquals(9, tester.getAllocatedHostsOf(tester.applicationId()).getHosts().size());
assertTrue(prepareResult.configChangeActions().getRestartActions().isEmpty()); // Handled by deployment.
assertEquals(Optional.of(ApplicationReindexing.empty()
.withPending("cluster", "music", prepareResult.sessionId())),
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/maintenance/MaintainerTester.java b/configserver/src/test/java/com/yahoo/vespa/config/server/maintenance/MaintainerTester.java
index ff6fc7d74c5..a2dc0216b72 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/maintenance/MaintainerTester.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/maintenance/MaintainerTester.java
@@ -31,7 +31,7 @@ class MaintainerTester {
MaintainerTester(Clock clock, TemporaryFolder temporaryFolder) throws IOException {
this.curator = new MockCurator();
- InMemoryProvisioner hostProvisioner = new InMemoryProvisioner(7, false);
+ InMemoryProvisioner hostProvisioner = new InMemoryProvisioner(9, false);
Provisioner provisioner = new MockProvisioner().hostProvisioner(hostProvisioner);
ConfigserverConfig configserverConfig = new ConfigserverConfig.Builder()
.hostedVespa(true)
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/model/LbServicesProducerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/model/LbServicesProducerTest.java
index ee35ca572e1..8167cd8a2ee 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/model/LbServicesProducerTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/model/LbServicesProducerTest.java
@@ -222,11 +222,6 @@ public class LbServicesProducerTest {
String services = "<services>" +
"<admin version='4.0'><logservers> <nodes count='1' /> </logservers></admin>" +
" <container id='mydisc' version='1.0'>" +
- " <aliases>" +
- " <endpoint-alias>foo2.bar2.com</endpoint-alias>" +
- " <service-alias>service1</service-alias>" +
- " <endpoint-alias>foo1.bar1.com</endpoint-alias>" +
- " </aliases>" +
" <nodes count='1' />" +
" <search/>" +
" </container>" +
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/tenant/TenantTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/tenant/TenantTest.java
index a0bd0e1f130..334119cd050 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/tenant/TenantTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/tenant/TenantTest.java
@@ -1,7 +1,6 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config.server.tenant;
-import com.google.common.testing.EqualsTester;
import com.yahoo.cloud.config.ConfigserverConfig;
import com.yahoo.config.provision.TenantName;
import org.junit.Before;
@@ -50,11 +49,10 @@ public class TenantTest {
@Test
public void equals() {
- new EqualsTester()
- .addEqualityGroup(t1, t2)
- .addEqualityGroup(t3)
- .addEqualityGroup(t4)
- .testEquals();
+ assertEquals(t1, t2);
+ assertNotEquals(t1, t3);
+ assertNotEquals(t1, t4);
+ assertNotEquals(t3, t4);
}
@Test