diff options
author | Jon Bratseth <bratseth@gmail.com> | 2023-01-06 13:11:46 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2023-01-06 13:11:46 +0100 |
commit | 8e66f239ab0230db3882bd63bb68e4a055ae5873 (patch) | |
tree | 02ade0bf1843d43dc80c9272bc9d9460a9e3d6d4 /node-repository/src/test/java | |
parent | 9d499d42bcca59c69cb87335a2555e2bbcbdb976 (diff) |
No functional changes
Diffstat (limited to 'node-repository/src/test/java')
-rw-r--r-- | node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTest.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTest.java index 4ce07d53ea9..d48a3d169a2 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTest.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTest.java @@ -743,6 +743,28 @@ public class AutoscalingTest { fixture.currentResources().advertisedResources()); } + /** Tests an autoscaling scenario which should cause in-place resize. */ + @Test + public void test_resize() { + var min = new ClusterResources(7, 1, new NodeResources( 2, 10, 384, 1)); + var now = new ClusterResources(7, 1, new NodeResources( 3.4, 16.2, 450.1, 1)); + var max = new ClusterResources(7, 1, new NodeResources( 4, 32, 768, 1)); + var fixture = AutoscalingTester.fixture() + .awsProdSetup(true) + .capacity(Capacity.from(min, max)) + .initialResources(Optional.of(now)) + .build(); + var initialNodes = fixture.nodes().asList(); + fixture.tester().clock().advance(Duration.ofDays(2)); + fixture.loader().applyLoad(new Load(0.06, 0.52, 0.27), 100); + var autoscaling = fixture.autoscale(); + fixture.tester().assertResources("Scaling down", + 7, 1, 2, 15.9, 384.0, + autoscaling); + fixture.deploy(Capacity.from(autoscaling.resources().get())); + assertEquals("Initial nodes are kept", initialNodes, fixture.nodes().asList()); + } + private ClusterSpec clusterSpec(boolean exclusive) { return ClusterSpec.request(ClusterSpec.Type.container, ClusterSpec.Id.from("test")).vespaVersion("8.1.2") |