add load test without persistence
so we can see what else is chewing up cpu
diff --git a/qa/src/main/java/org/apache/brooklyn/qa/load/SimulatedVanillaSoftwareProcessImpl.java b/qa/src/main/java/org/apache/brooklyn/qa/load/SimulatedVanillaSoftwareProcessImpl.java
index e5aea80..6b1d096 100644
--- a/qa/src/main/java/org/apache/brooklyn/qa/load/SimulatedVanillaSoftwareProcessImpl.java
+++ b/qa/src/main/java/org/apache/brooklyn/qa/load/SimulatedVanillaSoftwareProcessImpl.java
@@ -216,5 +216,14 @@
// no-op
}
}
+
+ @Override
+ public boolean isRunning() {
+ if (Boolean.TRUE.equals(entity.getConfig(USE_SSH_MONITORING))) {
+ return super.isRunning();
+ } else {
+ return true;
+ }
+ }
}
}
diff --git a/qa/src/test/java/org/apache/brooklyn/qa/load/AbstractLoadTest.java b/qa/src/test/java/org/apache/brooklyn/qa/load/AbstractLoadTest.java
index c07f329..56cd756 100644
--- a/qa/src/test/java/org/apache/brooklyn/qa/load/AbstractLoadTest.java
+++ b/qa/src/test/java/org/apache/brooklyn/qa/load/AbstractLoadTest.java
@@ -161,8 +161,8 @@
// Create management node
persistenceDir = Files.createTempDir();
launcher = BrooklynLauncher.newInstance()
- .persistMode(PersistMode.CLEAN)
- .highAvailabilityMode(HighAvailabilityMode.MASTER)
+ .persistMode(doPersistence() ? PersistMode.CLEAN : PersistMode.DISABLED)
+ .highAvailabilityMode(doPersistence() ? HighAvailabilityMode.MASTER : HighAvailabilityMode.DISABLED)
.persistenceDir(persistenceDir)
.start();
@@ -171,6 +171,10 @@
return launcher.getServerDetails().getManagementContext();
}
+
+ protected boolean doPersistence() {
+ return true;
+ }
@Override
protected void tearDownPlatform() {
diff --git a/qa/src/test/java/org/apache/brooklyn/qa/load/LoadWithoutPersistenceTest.java b/qa/src/test/java/org/apache/brooklyn/qa/load/LoadWithoutPersistenceTest.java
new file mode 100644
index 0000000..c69fc4f
--- /dev/null
+++ b/qa/src/test/java/org/apache/brooklyn/qa/load/LoadWithoutPersistenceTest.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.qa.load;
+
+import org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess;
+import org.apache.brooklyn.util.time.Duration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.Test;
+
+import com.google.common.base.Predicates;
+import com.google.common.base.Stopwatch;
+
+public class LoadWithoutPersistenceTest extends AbstractLoadTest {
+
+ private static final Logger log = LoggerFactory.getLogger(LoadWithoutPersistenceTest.class);
+
+ @Override
+ protected boolean doPersistence() {
+ return false;
+ }
+
+ /**
+ * Creates many SSH simulated external monitor apps, to ensure resource usage not extreme.
+ *
+ * Long-term target is 2500 VMs under management.
+ * Until we reach that point, we can partition the load across multiple (separate) brooklyn management nodes.
+ */
+ @Test(groups="Acceptance")
+ public void testManyAppsExternallyMonitored() throws Exception {
+ // TODO Getting ssh error ("Server closed connection during identification exchange")
+ // with only two cycles (i.e. 20 entities).
+ //
+ // The ssh activity is from `SoftwareProcessImpl.waitForEntityStart`, which calls
+ // `VanillaSoftwareProcessSshDriver.isRunning`.
+ final int TOTAL_APPS = 500; // target is 2500 VMs; each blueprint has 2 VanillaSoftwareProcess
+ final int NUM_APPS_PER_BATCH = 10;
+ Stopwatch startTime = Stopwatch.createStarted();
+ super.runLocalhostManyApps(new TestConfig(this)
+ .execSshOnStart(false) // getting ssh errors otherwise!
+ .useSshMonitoring(false) // getting ssh errors otherwise!
+ .simulateExternalMonitor(Predicates.instanceOf(VanillaSoftwareProcess.class), 5, Duration.ONE_SECOND)
+ .clusterSize(5)
+ .totalApps(TOTAL_APPS, NUM_APPS_PER_BATCH)
+ .sleepBetweenBatch(Duration.seconds(0)));
+ log.info("Created "+TOTAL_APPS+" apps in "+Duration.of(startTime));
+ }
+
+}