Skip to content

[fix][test] Flaky-test: CurrentLedgerRolloverIfFullTest.testCurrentLedgerRolloverIfFull - #23221

Closed
marekczajkowski wants to merge 1 commit into
apache:masterfrom
marekczajkowski:bugfix/current-ledger-rollower-test-race-condition
Closed

[fix][test] Flaky-test: CurrentLedgerRolloverIfFullTest.testCurrentLedgerRolloverIfFull#23221
marekczajkowski wants to merge 1 commit into
apache:masterfrom
marekczajkowski:bugfix/current-ledger-rollower-test-race-condition

Conversation

@marekczajkowski

Copy link
Copy Markdown
Contributor

Fixes #23161

Main Issue: #xyz

Motivation

java.lang.AssertionError: expected [5] but found [6]
at org.testng.Assert.fail(Assert.java:110)
at org.testng.Assert.failNotEquals(Assert.java:1577)
at org.testng.Assert.assertEqualsImpl(Assert.java:149)
at org.testng.Assert.assertEquals(Assert.java:131)
at org.testng.Assert.assertEquals(Assert.java:1418)
at org.testng.Assert.assertEquals(Assert.java:1382)
at org.testng.Assert.assertEquals(Assert.java:1428)
at org.apache.pulsar.broker.service.CurrentLedgerRolloverIfFullTest.testCurrentLedgerRolloverIfFull(CurrentLedgerRolloverIfFullTest.java:84)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:569)
at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:139)
at org.testng.internal.invokers.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:47)
at org.testng.internal.invokers.InvokeMethodRunnable.call(InvokeMethodRunnable.java:76)
at org.testng.internal.invokers.InvokeMethodRunnable.call(InvokeMethodRunnable.java:11)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)

Modifications

  • Change condition to check for correct number of ledgers
  • Introduce await() instead of assertion to avoid race condition (give time for new ledger creation)

Verifying this change

  • [ x] Make sure that the change passes the CI checks.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • [x ] doc-not-needed
  • doc-complete

@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label Aug 26, 2024
@marekczajkowski marekczajkowski changed the title Eliminate race condition and correct expected entries [fix][test] Flaky-test: CurrentLedgerRolloverIfFullTest.testCurrentLedgerRolloverIfFull Aug 26, 2024
@lhotari

lhotari commented Oct 14, 2024

Copy link
Copy Markdown
Member

Thanks for the contribution. It turns out that the flaky test was addressed as part of #23311.

@lhotari lhotari closed this Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky-test: CurrentLedgerRolloverIfFullTest.testCurrentLedgerRolloverIfFull

2 participants