Skip to content

[branch-2.8] testGetNumberOfEntriesInStorage is broken #16813

Closed

Description

@BewareMyPower

Describe the bug
In branch-2.8, ManagedLedgerTest#testGetNumberOfEntriesInStorage cannot pass. We can see the example failure from https://github.com/apache/pulsar/runs/7534114748?check_suite_focus=true and other earlier runs.

To Reproduce
Run the test, we can see

org.awaitility.core.ConditionTimeoutException: Assertion condition defined as a lambda expression in org.apache.bookkeeper.mledger.impl.ManagedLedgerTest that uses org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl expected [2] but found [3] within 10 seconds.

	at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:165)
	at org.awaitility.core.AssertionCondition.await(AssertionCondition.java:119)
	at org.awaitility.core.AssertionCondition.await(AssertionCondition.java:31)
	at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:895)
	at org.awaitility.core.ConditionFactory.untilAsserted(ConditionFactory.java:679)
	at org.apache.bookkeeper.mledger.impl.ManagedLedgerTest.testGetNumberOfEntriesInStorage(ManagedLedgerTest.java:2237)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:132)
	at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:599)
	at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:174)
	at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46)
	at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:822)
	at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:147)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128)

Expected behavior
The test should pass.

Activity

  1. added
    type/bug
    on Jul 27, 2022
  2. BewareMyPower commented on Jul 27, 2022

    @BewareMyPower
    ContributorAuthor

    This issue was introduced from #15627.

    I found #15627 (comment) mentioned this test relies on #14672 that should not be cherry-picked into release branches.

    @HQebupt Could you take a look?

  3. BewareMyPower commented on Jul 28, 2022

    @BewareMyPower
    ContributorAuthor

    This behavior is caused by the behavior change of ManagedLedgerImpl#rollCurrentLedgerIfFull in #14622, which should only be included in branch-2.11.

    Then I checked the test in branch-2.9 and branch-2.10.

    For branch-2.9, when 53615e0 cherry-picked #15837, it also changed the test to

            Awaitility.await().untilAsserted(() -> {
                assertEquals(managedLedger.getLedgersInfo().size(), 3);
                assertEquals(managedLedger.getState(), ManagedLedgerImpl.State.LedgerOpened);
            })

    see here

    For branch-2.10, this test failure was fixed by #15995.

    I will push a commit directly to fix the test in branch-2.8 soon. /cc @mattisonchao @codelipenghui @nicoloboschi

    Regarding the master branch and the incoming 2.11.0 release, #16806, which is marked as the release blocker, should restore the original behavior.

  4. BewareMyPower commented on Jul 28, 2022

    @BewareMyPower
    ContributorAuthor

    Close the issue by c534be7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions