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 — [improve][test] Add solution to PulsarMockBookKeeper for intercepting reads by lhotari · Pull Request #23875 · apache/pulsar Conversation
Member
MotivationIn Pulsar tests, in-memory PulsarMockBookKeeper is used to implement BookKeeper client API. Example usage: // introduce delay to reads pulsarTestContext.getMockBookKeeper().setReadHandleInterceptor((ledgerId, firstEntry, lastEntry, entries) -> { log.info("intercepted read entries for ledgerId {}, firstEntry={}, lastEntry={}", ledgerId, firstEntry, lastEntry); long delayMillis = ThreadLocalRandom.current().nextLong(25, 50); return CompletableFuture.supplyAsync(() -> entries, CompletableFuture.delayedExecutor(delayMillis, TimeUnit.MILLISECONDS)); }); The same approach can be used to inject failures. ModificationsAdd Documentation
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
1 of 4 tasks
lhotari
requested review from
Technoboy-,
dao-jun,
eolivelli,
nicoloboschi,
nodece,
shibd and
thetumbled
|
There was an error while loading. Please reload this page.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
… reads (apache#23875) (cherry picked from commit 87fb442) (cherry picked from commit 38f15bc)
… reads (apache#23875) (cherry picked from commit 87fb442) (cherry picked from commit 38f15bc)
… reads (apache#23875) (cherry picked from commit 87fb442)
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.