GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — [fix][test] Fix flaky EntryCacheManagerTest.simple by merlimat · Pull Request #27523 · apache/pulsar Conversation
Contributor
Motivation
The assertion that fails is the eviction count, after the test's own stats refresh: cache2.insert(EntryImpl.create(2, 3, new byte[1])); // size 10 > trigger threshold 9: one eviction factory2.waitForPendingCacheEvictions(); ... factory2.getMbean().refreshStats(1, TimeUnit.SECONDS); ... assertEquals(factory2.getMbean().getNumberOfCacheEvictions(), 1); // found 0
this.statsTask = scheduledExecutor.scheduleWithFixedDelay(catchingAndLoggingThrowables(this::refreshStats), 0, config.getStatsPeriodSeconds(), TimeUnit.SECONDS); That first run is a task on a freshly started The race is old (the zero initial delay and the assertion both predate 2022); #27223 is not involved, as it only changed ModificationsAssert on the cumulative counter, which refreshes don't reset: // The factory's own stats task also refreshes the per-period counters, and its first run may land after // the eviction, so check the total count that refreshes don't reset assertEquals(factory2.getMbean().getNumberOfCacheEvictionsTotal(), 1); The other assertions after the refresh read live values (cache size, entry counters) or per-period rates that are 0 in Verifying this change
Note (not changed here):
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsManagedLedgerFactoryImpl schedules its own stats refresh with an initial delay of 0. When that first run lands after the cache eviction and before the test's own refreshStats() call, it moves the eviction into a period the test never reads, and getNumberOfCacheEvictions() returns 0. Assert on getNumberOfCacheEvictionsTotal(), which refreshes don't reset. …manager-test-simple-flake
codelipenghui
approved these changes
Uh oh!
There was an error while loading. Please reload this page.
lhotari
pushed a commit
that referenced
this pull request
(cherry picked from commit 8b5238d)
poorbarcode
pushed a commit
to poorbarcode/pulsar
that referenced
this pull request
(cherry picked from commit 8b5238d)
poorbarcode
pushed a commit
to poorbarcode/pulsar
that referenced
this pull request
(cherry picked from commit 8b5238d)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabelsProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |