ARTEMIS-4237 SoakPagingTest/ReplicationFlowControlTest into soak-tests

This commit is contained in:
Clebert Suconic 2023-04-05 18:05:02 -04:00 committed by clebertsuconic
parent ff87b9c5cb
commit 301aadbf1a
6 changed files with 52 additions and 48 deletions

View File

@ -305,40 +305,6 @@
</args>
</configuration>
</execution>
<execution>
<phase>test-compile</phase>
<id>create0</id>
<goals>
<goal>create</goal>
</goals>
<configuration>
<!-- this makes it easier in certain envs -->
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
<instance>${basedir}/target/replicated-static0</instance>
<configuration>${basedir}/target/classes/servers/replicated-static0</configuration>
<args>
<arg>--java-options</arg>
<arg>-ea</arg>
</args>
</configuration>
</execution>
<execution>
<phase>test-compile</phase>
<id>create1</id>
<goals>
<goal>create</goal>
</goals>
<configuration>
<!-- this makes it easier in certain envs -->
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
<instance>${basedir}/target/replicated-static1</instance>
<configuration>${basedir}/target/classes/servers/replicated-static1</configuration>
<args>
<arg>--java-options</arg>
<arg>-ea</arg>
</args>
</configuration>
</execution>
<execution>
<phase>test-compile</phase>
<id>create-expire</id>

View File

@ -351,7 +351,40 @@
</args>
</configuration>
</execution>
<execution>
<phase>test-compile</phase>
<id>created-static0</id>
<goals>
<goal>create</goal>
</goals>
<configuration>
<!-- this makes it easier in certain envs -->
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
<instance>${basedir}/target/replicated-static0</instance>
<configuration>${basedir}/target/classes/servers/replicated-static0</configuration>
<args>
<arg>--java-options</arg>
<arg>-ea</arg>
</args>
</configuration>
</execution>
<execution>
<phase>test-compile</phase>
<id>create-replicated-static1</id>
<goals>
<goal>create</goal>
</goals>
<configuration>
<!-- this makes it easier in certain envs -->
<javaOptions>-Djava.net.preferIPv4Stack=true</javaOptions>
<instance>${basedir}/target/replicated-static1</instance>
<configuration>${basedir}/target/classes/servers/replicated-static1</configuration>
<args>
<arg>--java-options</arg>
<arg>-ea</arg>
</args>
</configuration>
</execution>
</executions>
</plugin>

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.activemq.artemis.tests.smoke.replicationflow;
package org.apache.activemq.artemis.tests.soak.replicationflow;
import javax.jms.BytesMessage;
import javax.jms.Connection;
@ -30,7 +30,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
import org.apache.activemq.artemis.tests.smoke.common.SmokeTestBase;
import org.apache.activemq.artemis.tests.soak.SoakTestBase;
import org.apache.activemq.artemis.util.ServerUtil;
import org.apache.activemq.artemis.utils.ReusableLatch;
import org.apache.qpid.jms.JmsConnectionFactory;
@ -39,7 +39,7 @@ import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class ReplicationFlowControlTest extends SmokeTestBase {
public class ReplicationFlowControlTest extends SoakTestBase {
public static final String SERVER_NAME_0 = "replicated-static0";
@ -47,7 +47,6 @@ public class ReplicationFlowControlTest extends SmokeTestBase {
ArrayList<Consumer> consumers = new ArrayList<>();
private static Process server0;
private static Process server1;
static final int NUM_MESSAGES = 50_000;
@ -60,7 +59,6 @@ public class ReplicationFlowControlTest extends SmokeTestBase {
static AtomicInteger totalConsumed = new AtomicInteger(0);
@Before
public void before() throws Exception {
cleanupData(SERVER_NAME_0);

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.activemq.artemis.tests.smoke.replicationflow;
package org.apache.activemq.artemis.tests.soak.replicationflow;
import javax.jms.BytesMessage;
import javax.jms.CompletionListener;
@ -44,6 +44,7 @@ import javax.jms.TextMessage;
import javax.jms.Topic;
import javax.jms.TopicSubscriber;
import java.io.Serializable;
import java.lang.invoke.MethodHandles;
import java.util.Arrays;
import java.util.Collection;
import java.util.Enumeration;
@ -51,7 +52,7 @@ import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.activemq.artemis.tests.smoke.common.SmokeTestBase;
import org.apache.activemq.artemis.tests.soak.SoakTestBase;
import org.apache.activemq.artemis.utils.ExecuteUtil;
import org.apache.activemq.artemis.utils.SpawnedVMSupport;
import org.apache.qpid.jms.JmsConnectionFactory;
@ -65,10 +66,9 @@ import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.lang.invoke.MethodHandles;
@RunWith(Parameterized.class)
public class SoakPagingTest extends SmokeTestBase {
public class SoakReplicatedPagingTest extends SoakTestBase {
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
@ -81,7 +81,7 @@ public class SoakPagingTest extends SmokeTestBase {
boolean transaction;
final String destination;
public SoakPagingTest(String protocol, String consumerType, boolean transaction) {
public SoakReplicatedPagingTest(String protocol, String consumerType, boolean transaction) {
this.protocol = protocol;
this.consumerType = consumerType;
this.transaction = transaction;
@ -162,7 +162,7 @@ public class SoakPagingTest extends SmokeTestBase {
Thread t = new Thread(new Runnable() {
@Override
public void run() {
SoakPagingTest app = new SoakPagingTest(protocol, consumerType, tx);
SoakReplicatedPagingTest app = new SoakReplicatedPagingTest(protocol, consumerType, tx);
app.produce(factory, producer_count.incrementAndGet(), producersLatch);
}
});
@ -175,7 +175,7 @@ public class SoakPagingTest extends SmokeTestBase {
Thread t = new Thread(new Runnable() {
@Override
public void run() {
SoakPagingTest app = new SoakPagingTest(protocol, consumerType, tx);
SoakReplicatedPagingTest app = new SoakReplicatedPagingTest(protocol, consumerType, tx);
app.consume(factory, consumer_count.getAndIncrement(), consumersLatch);
}
});
@ -214,7 +214,14 @@ public class SoakPagingTest extends SmokeTestBase {
server1 = startServer(SERVER_NAME_1, 0, 30000);
for (int i = 0; i < CLIENT_KILLS; i++) {
Process process = SpawnedVMSupport.spawnVM(SoakPagingTest.class.getName(), protocol, consumerType, "" + TIME_RUNNING, "" + transaction);
Process process = SpawnedVMSupport.spawnVM(SpawnedVMSupport.getClassPath(),
null,
null,
SoakReplicatedPagingTest.class.getName(),
null,
"-Xmx1G",
null, true, true, -1L, protocol, String.valueOf(consumerType), String.valueOf(TIME_RUNNING), String.valueOf(transaction));
int result = process.waitFor();
if (result <= 0) {