You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by pe...@apache.org on 2022/06/10 13:53:14 UTC

[pulsar] branch branch-2.10 updated: Fix failed tests for branch-2.10 (#15995)

This is an automated email from the ASF dual-hosted git repository.

penghui pushed a commit to branch branch-2.10
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-2.10 by this push:
     new 0b7bacc448a Fix failed tests for branch-2.10 (#15995)
0b7bacc448a is described below

commit 0b7bacc448af267e0c3ea147df6de819efcc7b2f
Author: lipenghui <pe...@apache.org>
AuthorDate: Fri Jun 10 21:53:02 2022 +0800

    Fix failed tests for branch-2.10 (#15995)
    
    Fixes: #16000
    
    After cherry-picked #15627, the test `org.apache.bookkeeper.mledger.impl.ManagedLedgerTest`
    will fail for branch-2.10. Details to see https://github.com/apache/pulsar/pull/15627#issuecomment-1149962309
    
    Not 100% sure what's going on for now, but looks like It's related to the concurrency issue in the class initialization. Just found some related information.
    
    https://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html#parallel-test-execution
    
    https://github.com/testcontainers/testcontainers-java/issues/2939#issuecomment-649810918
---
 build/run_unit_group.sh                                               | 2 +-
 .../java/org/apache/bookkeeper/mledger/impl/ManagedLedgerTest.java    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/build/run_unit_group.sh b/build/run_unit_group.sh
index ca5b887780a..19dc713d700 100755
--- a/build/run_unit_group.sh
+++ b/build/run_unit_group.sh
@@ -42,7 +42,7 @@ function broker_group_1() {
 }
 
 function broker_group_2() {
-  $MVN_TEST_COMMAND -pl pulsar-broker -Dgroups='schema,utils,functions-worker,broker-io,broker-discovery,broker-compaction,broker-naming,websocket,other'
+  $MVN_TEST_COMMAND -pl pulsar-broker -Dgroups='schema,utils,functions-worker,broker-io,broker-discovery,broker-compaction,broker-naming,websocket,other' -DtestReuseFork=false
 }
 
 function broker_group_3() {
diff --git a/managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerTest.java b/managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerTest.java
index 8f6fdfe6640..8e7a77c7a50 100644
--- a/managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerTest.java
+++ b/managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerTest.java
@@ -2293,8 +2293,8 @@ public class ManagedLedgerTest extends MockedBookKeeperTestCase {
         stateUpdater.set(managedLedger, ManagedLedgerImpl.State.LedgerOpened);
         managedLedger.rollCurrentLedgerIfFull();
         Awaitility.await().untilAsserted(() -> {
-            assertEquals(managedLedger.getLedgersInfo().size(), 2);
-            assertEquals(managedLedger.getState(), ManagedLedgerImpl.State.ClosedLedger);
+            assertEquals(managedLedger.getLedgersInfo().size(), 3);
+            assertEquals(managedLedger.getState(), ManagedLedgerImpl.State.LedgerOpened);
         });
         assertEquals(5, managedLedger.getLedgersInfoAsList().get(0).getEntries());
         assertEquals(5, managedLedger.getLedgersInfoAsList().get(1).getEntries());