From c52f50f046fd1a8e1c7f17d9a1952e2bd92aeb4c Mon Sep 17 00:00:00 2001 From: Mick Semb Wever Date: Thu, 15 Apr 2021 16:57:36 +0200 Subject: [PATCH] Restore running each test class in its own separate jvm and cassandra directory (Remove test parallelism from ant build.xml) patch by Mick Semb Wever; reviewed by Yifan Cai, David Capwell for CASSANDRA-16595 --- build.xml | 66 ++++++++++++++----- .../OffsetAwareConfigurationLoader.java | 63 ------------------ 2 files changed, 49 insertions(+), 80 deletions(-) delete mode 100644 test/unit/org/apache/cassandra/OffsetAwareConfigurationLoader.java diff --git a/build.xml b/build.xml index cbe45ba51f..95f85c05a9 100644 --- a/build.xml +++ b/build.xml @@ -1268,6 +1268,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -1335,9 +1370,9 @@ - - - + + + @@ -1410,7 +1445,6 @@ - @@ -1436,7 +1470,6 @@ - @@ -1479,8 +1512,8 @@ - - + + @@ -1740,13 +1773,12 @@ - @@ -1767,8 +1799,8 @@ - - + + @@ -1787,16 +1819,16 @@ - - + + - - + + diff --git a/test/unit/org/apache/cassandra/OffsetAwareConfigurationLoader.java b/test/unit/org/apache/cassandra/OffsetAwareConfigurationLoader.java deleted file mode 100644 index 9023b11ef2..0000000000 --- a/test/unit/org/apache/cassandra/OffsetAwareConfigurationLoader.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * 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.cassandra; - -import org.apache.cassandra.config.Config; -import org.apache.cassandra.config.YamlConfigurationLoader; -import org.apache.cassandra.exceptions.ConfigurationException; - -import java.io.File; - - -public class OffsetAwareConfigurationLoader extends YamlConfigurationLoader -{ - - static final String OFFSET_PROPERTY = "cassandra.test.offsetseed"; - int offset = 0; - - public OffsetAwareConfigurationLoader() - { - String offsetStr = System.getProperty(OFFSET_PROPERTY); - - if (offsetStr == null) - throw new RuntimeException("offset property is not set: "+OFFSET_PROPERTY); - - offset = Integer.valueOf(offsetStr); - - assert offset >= 0; - } - - @Override - public Config loadConfig() throws ConfigurationException - { - Config config = super.loadConfig(); - - - config.rpc_port += offset; - config.native_transport_port += offset; - config.storage_port += offset; - - config.commitlog_directory += File.pathSeparator + offset; - config.saved_caches_directory += File.pathSeparator + offset; - for (int i = 0; i < config.data_file_directories.length; i++) - config.data_file_directories[i] += File.pathSeparator + offset; - - - return config; - } -}