aboutsummaryrefslogtreecommitdiffstats
path: root/controller-server/src/test/java
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2019-04-27 20:36:14 +0200
committerMartin Polden <mpolden@mpolden.no>2019-04-29 13:17:29 +0200
commitc02fa97f0949d2be1baa9318d08e43a57196fcd5 (patch)
treee8ca3663cc472ecb5deec510ca9812c139117a53 /controller-server/src/test/java
parent709a4dd3cff426eb0f365e547c6322f6d26f6a2c (diff)
Remove redundant rate limit
Diffstat (limited to 'controller-server/src/test/java')
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTester.java2
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/DnsMaintainerTest.java33
2 files changed, 2 insertions, 33 deletions
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTester.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTester.java
index 2b0ee741e7e..d01e2f2497f 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTester.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTester.java
@@ -74,7 +74,7 @@ import static org.junit.Assert.assertNotNull;
*/
public final class ControllerTester {
- public static final int availableRotations = 10;
+ private static final int availableRotations = 10;
private final AthenzDbMock athenzDb;
private final ManualClock clock;
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/DnsMaintainerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/DnsMaintainerTest.java
index 13218cc2442..e40ea49bd8c 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/DnsMaintainerTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/DnsMaintainerTest.java
@@ -6,17 +6,12 @@ import com.yahoo.config.provision.Environment;
import com.yahoo.config.provision.RegionName;
import com.yahoo.config.provision.zone.ZoneId;
import com.yahoo.vespa.hosted.controller.Application;
-import com.yahoo.vespa.hosted.controller.ControllerTester;
import com.yahoo.vespa.hosted.controller.api.integration.dns.Record;
-import com.yahoo.vespa.hosted.controller.api.integration.dns.RecordData;
import com.yahoo.vespa.hosted.controller.api.integration.dns.RecordName;
import com.yahoo.vespa.hosted.controller.application.ApplicationPackage;
-import com.yahoo.vespa.hosted.controller.application.Endpoint;
import com.yahoo.vespa.hosted.controller.deployment.ApplicationPackageBuilder;
import com.yahoo.vespa.hosted.controller.deployment.DeploymentTester;
import com.yahoo.vespa.hosted.controller.persistence.MockCuratorDb;
-import com.yahoo.vespa.hosted.controller.rotation.Rotation;
-import com.yahoo.vespa.hosted.controller.rotation.RotationId;
import org.junit.Before;
import org.junit.Test;
@@ -101,41 +96,15 @@ public class DnsMaintainerTest {
tester.controllerTester().deleteApplication(application.id());
// DnsMaintainer removes records
- for (int i = 0; i < ControllerTester.availableRotations; i++) {
- maintainer.maintain();
- }
+ maintainer.maintain();
tester.updateDns();
assertFalse("DNS record removed", findCname.apply("app1--tenant1.global.vespa.yahooapis.com").isPresent());
assertFalse("DNS record removed", findCname.apply("app1--tenant1.global.vespa.oath.cloud").isPresent());
assertFalse("DNS record removed", findCname.apply("app1.tenant1.global.vespa.yahooapis.com").isPresent());
}
- @Test
- public void rate_limit_record_removal() {
- // Create stale records
- int staleTotal = ControllerTester.availableRotations;
- for (int i = 1; i <= staleTotal; i++) {
- Rotation r = rotation(i);
- tester.controllerTester().nameService().createCname(RecordName.from("stale-record-" + i + "." +
- Endpoint.OATH_DNS_SUFFIX),
- RecordData.from(r.name() + "."));
- }
-
- // One record is removed per run
- for (int i = 1; i <= staleTotal*2; i++) {
- maintainer.run();
- tester.updateDns();
- assertEquals(Math.max(staleTotal - i, 0), records().size());
- }
- }
-
private Set<Record> records() {
return tester.controllerTester().nameService().records();
}
- private static Rotation rotation(int n) {
- String id = String.format("%02d", n);
- return new Rotation(new RotationId("rotation-id-" + id), "rotation-fqdn-" + id);
- }
-
}