diff --git a/src/java/org/apache/cassandra/utils/SlidingTimeRate.java b/src/java/org/apache/cassandra/utils/SlidingTimeRate.java index 5e3936eef1..0e00054d02 100644 --- a/src/java/org/apache/cassandra/utils/SlidingTimeRate.java +++ b/src/java/org/apache/cassandra/utils/SlidingTimeRate.java @@ -30,6 +30,9 @@ import com.google.common.base.Preconditions; /** * Concurrent rate computation over a sliding time window. + * + * Currently not used in the Cassandra 4.0 code base. If you decide to use it, please check CASSANDRA-16713. + * There still might be a bug, flaky test to be fixed before using it again. */ public class SlidingTimeRate { diff --git a/test/unit/org/apache/cassandra/utils/SlidingTimeRateTest.java b/test/unit/org/apache/cassandra/utils/SlidingTimeRateTest.java index 8c11f9d263..8dc4a14d6d 100644 --- a/test/unit/org/apache/cassandra/utils/SlidingTimeRateTest.java +++ b/test/unit/org/apache/cassandra/utils/SlidingTimeRateTest.java @@ -22,10 +22,19 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; +/** + * No objects are created currently from SlidingTimeRate in Cassandra 4.0. + * If you decide to use it, please check CASSANDRA-16713. + * There still might be a bug, flaky test to be fixed before using it again. + * + * Skipping all tests for running now to clean he noise before 4.0 GA release. + */ public class SlidingTimeRateTest { + @Ignore @Test public void testUpdateAndGet() { @@ -38,8 +47,9 @@ public class SlidingTimeRateTest Assert.assertEquals(updates, rate.get(TimeUnit.SECONDS), 0.0); } + @Ignore @Test - public void testUpdateAndGetBetweenWindows() throws InterruptedException + public void testUpdateAndGetBetweenWindows() { TestTimeSource time = new TestTimeSource(); SlidingTimeRate rate = new SlidingTimeRate(time, 5, 1, TimeUnit.SECONDS); @@ -52,8 +62,9 @@ public class SlidingTimeRateTest Assert.assertEquals(10, rate.get(TimeUnit.SECONDS), 0.0); } + @Ignore @Test - public void testUpdateAndGetPastWindowSize() throws InterruptedException + public void testUpdateAndGetPastWindowSize() { TestTimeSource time = new TestTimeSource(); SlidingTimeRate rate = new SlidingTimeRate(time, 5, 1, TimeUnit.SECONDS); @@ -68,8 +79,9 @@ public class SlidingTimeRateTest Assert.assertEquals(0, rate.get(TimeUnit.SECONDS), 0.0); } + @Ignore @Test - public void testUpdateAndGetToPointInTime() throws InterruptedException + public void testUpdateAndGetToPointInTime() { TestTimeSource time = new TestTimeSource(); SlidingTimeRate rate = new SlidingTimeRate(time, 5, 1, TimeUnit.SECONDS); @@ -86,6 +98,7 @@ public class SlidingTimeRateTest Assert.assertEquals(10, rate.get(1, TimeUnit.SECONDS), 0.0); } + @Ignore @Test public void testDecay() throws InterruptedException { @@ -108,8 +121,9 @@ public class SlidingTimeRateTest Assert.assertEquals(2.5, rate.get(TimeUnit.SECONDS), 0.0); } + @Ignore @Test - public void testPruning() throws InterruptedException + public void testPruning() { TestTimeSource time = new TestTimeSource(); SlidingTimeRate rate = new SlidingTimeRate(time, 5, 1, TimeUnit.SECONDS); @@ -123,6 +137,7 @@ public class SlidingTimeRateTest Assert.assertEquals(0, rate.size()); } + @Ignore @Test public void testConcurrentUpdateAndGet() throws InterruptedException {