You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by jb...@apache.org on 2024/01/22 15:11:56 UTC
(activemq-artemis) branch main updated: NO-JIRA Fix PagingStoreImplTest#testBlockUnblock random failure
This is an automated email from the ASF dual-hosted git repository.
jbertram pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git
The following commit(s) were added to refs/heads/main by this push:
new 5e99516a27 NO-JIRA Fix PagingStoreImplTest#testBlockUnblock random failure
5e99516a27 is described below
commit 5e99516a27f2fff55355006641c1059ffba350cd
Author: Howard Gao <ho...@gmail.com>
AuthorDate: Mon Jan 22 21:57:32 2024 +0800
NO-JIRA Fix PagingStoreImplTest#testBlockUnblock random failure
PagingStroeImpl.checkReleasedMemory() will kick off
executor.execute(this::memoryReleased) to pull from the queue onMemoryFreedRunnables
asynchronously. If the executor fires the task too late, it can pick up one of the
late trackMemoryChecks runnable and increase its calls, making assertion fail.
need to flush the executors to make sure it doesn't happen.
---
.../artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java
index 3c0835fa3c..f75fb75940 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingStoreImplTest.java
@@ -1252,6 +1252,7 @@ public class PagingStoreImplTest extends ActiveMQTestBase {
};
store.applySetting(new AddressSettings().setMaxSizeBytes(1000).setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK));
store.addSize(100);
+ store.flushExecutors();
store.checkMemory(trackMemoryChecks, null);
assertEquals(1, calls.get());
@@ -1270,6 +1271,7 @@ public class PagingStoreImplTest extends ActiveMQTestBase {
store.addSize(900);
assertEquals(100, store.getAddressLimitPercent());
+ store.flushExecutors();
// address full blocks
store.checkMemory(trackMemoryChecks, null);
@@ -1285,6 +1287,7 @@ public class PagingStoreImplTest extends ActiveMQTestBase {
assertEquals(2, calls.get());
store.unblock();
+ store.flushExecutors();
// now released
assertTrue(Wait.waitFor(new Wait.Condition() {