(hbase) branch branch-2.4 updated: HBASE-28324 TestRegionNormalizerWorkQueue#testTake is flaky (#5643)
This is an automated email from the ASF dual-hosted git repository. sunxin pushed a commit to branch branch-2.4 in repository https://gitbox.apache.org/repos/asf/hbase.git The following commit(s) were added to refs/heads/branch-2.4 by this push: new 7ced6d3e51c HBASE-28324 TestRegionNormalizerWorkQueue#testTake is flaky (#5643) 7ced6d3e51c is described below commit 7ced6d3e51cb4c1c47c76805c98411a512348494 Author: Xin Sun AuthorDate: Mon Jan 22 14:02:11 2024 +0800 HBASE-28324 TestRegionNormalizerWorkQueue#testTake is flaky (#5643) Signed-off-by: Duo Zhang --- .../master/normalizer/TestRegionNormalizerWorkQueue.java| 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorkQueue.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorkQueue.java index c6d14c19114..088df7e7376 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorkQueue.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorkQueue.java @@ -22,7 +22,6 @@ import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.lessThanOrEqualTo; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.util.ArrayList; @@ -41,6 +40,8 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; import java.util.stream.IntStream; import org.apache.hadoop.hbase.HBaseClassTestRule; +import org.apache.hadoop.hbase.HBaseConfiguration; +import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.junit.ClassRule; @@ -186,6 +187,7 @@ public class TestRegionNormalizerWorkQueue { final RegionNormalizerWorkQueue queue = new RegionNormalizerWorkQueue<>(); final ConcurrentLinkedQueue takeTimes = new ConcurrentLinkedQueue<>(); final AtomicBoolean finished = new AtomicBoolean(false); +final int count = 5; final Runnable consumer = () -> { try { while (!finished.get()) { @@ -199,11 +201,12 @@ public class TestRegionNormalizerWorkQueue { CompletableFuture worker = CompletableFuture.runAsync(consumer); final long testStart = System.nanoTime(); -for (int i = 0; i < 5; i++) { +for (int i = 0; i < count; i++) { Thread.sleep(10); queue.put(i); } - +// should have timing information for 5 calls to take. +Waiter.waitFor(HBaseConfiguration.create(), 1000, () -> count == takeTimes.size()); // set finished = true and pipe one more value in case the thread needs an extra pass through // the loop. finished.set(true); @@ -211,9 +214,7 @@ public class TestRegionNormalizerWorkQueue { worker.get(1, TimeUnit.SECONDS); final Iterator times = takeTimes.iterator(); -assertTrue("should have timing information for at least 2 calls to take.", - takeTimes.size() >= 5); -for (int i = 0; i < 5; i++) { +for (int i = 0; i < count; i++) { assertThat( "Observations collected in takeTimes should increase by roughly 10ms every interval", times.next(), greaterThan(testStart + TimeUnit.MILLISECONDS.toNanos(i * 10)));
(hbase) branch branch-2.6 updated: HBASE-28324 TestRegionNormalizerWorkQueue#testTake is flaky (#5643)
This is an automated email from the ASF dual-hosted git repository. sunxin pushed a commit to branch branch-2.6 in repository https://gitbox.apache.org/repos/asf/hbase.git The following commit(s) were added to refs/heads/branch-2.6 by this push: new 541eee0b35c HBASE-28324 TestRegionNormalizerWorkQueue#testTake is flaky (#5643) 541eee0b35c is described below commit 541eee0b35c0156903509e3ddfc95ab953d66906 Author: Xin Sun AuthorDate: Mon Jan 22 14:02:11 2024 +0800 HBASE-28324 TestRegionNormalizerWorkQueue#testTake is flaky (#5643) Signed-off-by: Duo Zhang --- .../master/normalizer/TestRegionNormalizerWorkQueue.java| 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorkQueue.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorkQueue.java index c6d14c19114..088df7e7376 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorkQueue.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorkQueue.java @@ -22,7 +22,6 @@ import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.lessThanOrEqualTo; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.util.ArrayList; @@ -41,6 +40,8 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; import java.util.stream.IntStream; import org.apache.hadoop.hbase.HBaseClassTestRule; +import org.apache.hadoop.hbase.HBaseConfiguration; +import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.junit.ClassRule; @@ -186,6 +187,7 @@ public class TestRegionNormalizerWorkQueue { final RegionNormalizerWorkQueue queue = new RegionNormalizerWorkQueue<>(); final ConcurrentLinkedQueue takeTimes = new ConcurrentLinkedQueue<>(); final AtomicBoolean finished = new AtomicBoolean(false); +final int count = 5; final Runnable consumer = () -> { try { while (!finished.get()) { @@ -199,11 +201,12 @@ public class TestRegionNormalizerWorkQueue { CompletableFuture worker = CompletableFuture.runAsync(consumer); final long testStart = System.nanoTime(); -for (int i = 0; i < 5; i++) { +for (int i = 0; i < count; i++) { Thread.sleep(10); queue.put(i); } - +// should have timing information for 5 calls to take. +Waiter.waitFor(HBaseConfiguration.create(), 1000, () -> count == takeTimes.size()); // set finished = true and pipe one more value in case the thread needs an extra pass through // the loop. finished.set(true); @@ -211,9 +214,7 @@ public class TestRegionNormalizerWorkQueue { worker.get(1, TimeUnit.SECONDS); final Iterator times = takeTimes.iterator(); -assertTrue("should have timing information for at least 2 calls to take.", - takeTimes.size() >= 5); -for (int i = 0; i < 5; i++) { +for (int i = 0; i < count; i++) { assertThat( "Observations collected in takeTimes should increase by roughly 10ms every interval", times.next(), greaterThan(testStart + TimeUnit.MILLISECONDS.toNanos(i * 10)));
(hbase) branch branch-2.5 updated: HBASE-28324 TestRegionNormalizerWorkQueue#testTake is flaky (#5643)
This is an automated email from the ASF dual-hosted git repository. sunxin pushed a commit to branch branch-2.5 in repository https://gitbox.apache.org/repos/asf/hbase.git The following commit(s) were added to refs/heads/branch-2.5 by this push: new e497d12a6aa HBASE-28324 TestRegionNormalizerWorkQueue#testTake is flaky (#5643) e497d12a6aa is described below commit e497d12a6aa48c1196ff44641f85bb93d92cfbf6 Author: Xin Sun AuthorDate: Mon Jan 22 14:02:11 2024 +0800 HBASE-28324 TestRegionNormalizerWorkQueue#testTake is flaky (#5643) Signed-off-by: Duo Zhang --- .../master/normalizer/TestRegionNormalizerWorkQueue.java| 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorkQueue.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorkQueue.java index c6d14c19114..088df7e7376 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorkQueue.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorkQueue.java @@ -22,7 +22,6 @@ import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.lessThanOrEqualTo; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.util.ArrayList; @@ -41,6 +40,8 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; import java.util.stream.IntStream; import org.apache.hadoop.hbase.HBaseClassTestRule; +import org.apache.hadoop.hbase.HBaseConfiguration; +import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.junit.ClassRule; @@ -186,6 +187,7 @@ public class TestRegionNormalizerWorkQueue { final RegionNormalizerWorkQueue queue = new RegionNormalizerWorkQueue<>(); final ConcurrentLinkedQueue takeTimes = new ConcurrentLinkedQueue<>(); final AtomicBoolean finished = new AtomicBoolean(false); +final int count = 5; final Runnable consumer = () -> { try { while (!finished.get()) { @@ -199,11 +201,12 @@ public class TestRegionNormalizerWorkQueue { CompletableFuture worker = CompletableFuture.runAsync(consumer); final long testStart = System.nanoTime(); -for (int i = 0; i < 5; i++) { +for (int i = 0; i < count; i++) { Thread.sleep(10); queue.put(i); } - +// should have timing information for 5 calls to take. +Waiter.waitFor(HBaseConfiguration.create(), 1000, () -> count == takeTimes.size()); // set finished = true and pipe one more value in case the thread needs an extra pass through // the loop. finished.set(true); @@ -211,9 +214,7 @@ public class TestRegionNormalizerWorkQueue { worker.get(1, TimeUnit.SECONDS); final Iterator times = takeTimes.iterator(); -assertTrue("should have timing information for at least 2 calls to take.", - takeTimes.size() >= 5); -for (int i = 0; i < 5; i++) { +for (int i = 0; i < count; i++) { assertThat( "Observations collected in takeTimes should increase by roughly 10ms every interval", times.next(), greaterThan(testStart + TimeUnit.MILLISECONDS.toNanos(i * 10)));
(hbase) branch branch-3 updated: HBASE-28324 TestRegionNormalizerWorkQueue#testTake is flaky (#5643)
This is an automated email from the ASF dual-hosted git repository. sunxin pushed a commit to branch branch-3 in repository https://gitbox.apache.org/repos/asf/hbase.git The following commit(s) were added to refs/heads/branch-3 by this push: new 468cc2e1309 HBASE-28324 TestRegionNormalizerWorkQueue#testTake is flaky (#5643) 468cc2e1309 is described below commit 468cc2e130991388de3e14bd2a2837d53d78972d Author: Xin Sun AuthorDate: Mon Jan 22 14:02:11 2024 +0800 HBASE-28324 TestRegionNormalizerWorkQueue#testTake is flaky (#5643) Signed-off-by: Duo Zhang --- .../master/normalizer/TestRegionNormalizerWorkQueue.java| 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorkQueue.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorkQueue.java index c6d14c19114..088df7e7376 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorkQueue.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorkQueue.java @@ -22,7 +22,6 @@ import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.lessThanOrEqualTo; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.util.ArrayList; @@ -41,6 +40,8 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; import java.util.stream.IntStream; import org.apache.hadoop.hbase.HBaseClassTestRule; +import org.apache.hadoop.hbase.HBaseConfiguration; +import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.junit.ClassRule; @@ -186,6 +187,7 @@ public class TestRegionNormalizerWorkQueue { final RegionNormalizerWorkQueue queue = new RegionNormalizerWorkQueue<>(); final ConcurrentLinkedQueue takeTimes = new ConcurrentLinkedQueue<>(); final AtomicBoolean finished = new AtomicBoolean(false); +final int count = 5; final Runnable consumer = () -> { try { while (!finished.get()) { @@ -199,11 +201,12 @@ public class TestRegionNormalizerWorkQueue { CompletableFuture worker = CompletableFuture.runAsync(consumer); final long testStart = System.nanoTime(); -for (int i = 0; i < 5; i++) { +for (int i = 0; i < count; i++) { Thread.sleep(10); queue.put(i); } - +// should have timing information for 5 calls to take. +Waiter.waitFor(HBaseConfiguration.create(), 1000, () -> count == takeTimes.size()); // set finished = true and pipe one more value in case the thread needs an extra pass through // the loop. finished.set(true); @@ -211,9 +214,7 @@ public class TestRegionNormalizerWorkQueue { worker.get(1, TimeUnit.SECONDS); final Iterator times = takeTimes.iterator(); -assertTrue("should have timing information for at least 2 calls to take.", - takeTimes.size() >= 5); -for (int i = 0; i < 5; i++) { +for (int i = 0; i < count; i++) { assertThat( "Observations collected in takeTimes should increase by roughly 10ms every interval", times.next(), greaterThan(testStart + TimeUnit.MILLISECONDS.toNanos(i * 10)));
(hbase) branch branch-2 updated: HBASE-28324 TestRegionNormalizerWorkQueue#testTake is flaky (#5643)
This is an automated email from the ASF dual-hosted git repository. sunxin pushed a commit to branch branch-2 in repository https://gitbox.apache.org/repos/asf/hbase.git The following commit(s) were added to refs/heads/branch-2 by this push: new c9d85442c11 HBASE-28324 TestRegionNormalizerWorkQueue#testTake is flaky (#5643) c9d85442c11 is described below commit c9d85442c11454e6aeefc5a48e63568ce9eca636 Author: Xin Sun AuthorDate: Mon Jan 22 14:02:11 2024 +0800 HBASE-28324 TestRegionNormalizerWorkQueue#testTake is flaky (#5643) Signed-off-by: Duo Zhang --- .../master/normalizer/TestRegionNormalizerWorkQueue.java| 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorkQueue.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorkQueue.java index c6d14c19114..088df7e7376 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorkQueue.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorkQueue.java @@ -22,7 +22,6 @@ import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.lessThanOrEqualTo; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.util.ArrayList; @@ -41,6 +40,8 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; import java.util.stream.IntStream; import org.apache.hadoop.hbase.HBaseClassTestRule; +import org.apache.hadoop.hbase.HBaseConfiguration; +import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.junit.ClassRule; @@ -186,6 +187,7 @@ public class TestRegionNormalizerWorkQueue { final RegionNormalizerWorkQueue queue = new RegionNormalizerWorkQueue<>(); final ConcurrentLinkedQueue takeTimes = new ConcurrentLinkedQueue<>(); final AtomicBoolean finished = new AtomicBoolean(false); +final int count = 5; final Runnable consumer = () -> { try { while (!finished.get()) { @@ -199,11 +201,12 @@ public class TestRegionNormalizerWorkQueue { CompletableFuture worker = CompletableFuture.runAsync(consumer); final long testStart = System.nanoTime(); -for (int i = 0; i < 5; i++) { +for (int i = 0; i < count; i++) { Thread.sleep(10); queue.put(i); } - +// should have timing information for 5 calls to take. +Waiter.waitFor(HBaseConfiguration.create(), 1000, () -> count == takeTimes.size()); // set finished = true and pipe one more value in case the thread needs an extra pass through // the loop. finished.set(true); @@ -211,9 +214,7 @@ public class TestRegionNormalizerWorkQueue { worker.get(1, TimeUnit.SECONDS); final Iterator times = takeTimes.iterator(); -assertTrue("should have timing information for at least 2 calls to take.", - takeTimes.size() >= 5); -for (int i = 0; i < 5; i++) { +for (int i = 0; i < count; i++) { assertThat( "Observations collected in takeTimes should increase by roughly 10ms every interval", times.next(), greaterThan(testStart + TimeUnit.MILLISECONDS.toNanos(i * 10)));
(hbase) branch master updated: HBASE-28324 TestRegionNormalizerWorkQueue#testTake is flaky (#5643)
This is an automated email from the ASF dual-hosted git repository. sunxin pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/hbase.git The following commit(s) were added to refs/heads/master by this push: new 2f6b6ad HBASE-28324 TestRegionNormalizerWorkQueue#testTake is flaky (#5643) 2f6b6ad is described below commit 2f6b6ad6f036a5604378cfa1b84d4a245fca Author: Xin Sun AuthorDate: Mon Jan 22 14:02:11 2024 +0800 HBASE-28324 TestRegionNormalizerWorkQueue#testTake is flaky (#5643) Signed-off-by: Duo Zhang --- .../master/normalizer/TestRegionNormalizerWorkQueue.java| 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorkQueue.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorkQueue.java index c6d14c19114..088df7e7376 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorkQueue.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorkQueue.java @@ -22,7 +22,6 @@ import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.lessThanOrEqualTo; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.util.ArrayList; @@ -41,6 +40,8 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; import java.util.stream.IntStream; import org.apache.hadoop.hbase.HBaseClassTestRule; +import org.apache.hadoop.hbase.HBaseConfiguration; +import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.junit.ClassRule; @@ -186,6 +187,7 @@ public class TestRegionNormalizerWorkQueue { final RegionNormalizerWorkQueue queue = new RegionNormalizerWorkQueue<>(); final ConcurrentLinkedQueue takeTimes = new ConcurrentLinkedQueue<>(); final AtomicBoolean finished = new AtomicBoolean(false); +final int count = 5; final Runnable consumer = () -> { try { while (!finished.get()) { @@ -199,11 +201,12 @@ public class TestRegionNormalizerWorkQueue { CompletableFuture worker = CompletableFuture.runAsync(consumer); final long testStart = System.nanoTime(); -for (int i = 0; i < 5; i++) { +for (int i = 0; i < count; i++) { Thread.sleep(10); queue.put(i); } - +// should have timing information for 5 calls to take. +Waiter.waitFor(HBaseConfiguration.create(), 1000, () -> count == takeTimes.size()); // set finished = true and pipe one more value in case the thread needs an extra pass through // the loop. finished.set(true); @@ -211,9 +214,7 @@ public class TestRegionNormalizerWorkQueue { worker.get(1, TimeUnit.SECONDS); final Iterator times = takeTimes.iterator(); -assertTrue("should have timing information for at least 2 calls to take.", - takeTimes.size() >= 5); -for (int i = 0; i < 5; i++) { +for (int i = 0; i < count; i++) { assertThat( "Observations collected in takeTimes should increase by roughly 10ms every interval", times.next(), greaterThan(testStart + TimeUnit.MILLISECONDS.toNanos(i * 10)));