GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [improve][test] Add solution to PulsarMockBookKeeper for intercepting reads by lhotari · Pull Request #23875 · apache/pulsar

Conversation

@lhotari

@lhotari lhotari commented Jan 22, 2025

Copy link
Copy Markdown
Member

Motivation

In Pulsar tests, in-memory PulsarMockBookKeeper is used to implement BookKeeper client API.
There hasn't been a way to write realistic tests where there's variable latencies in BookKeeper reads.
Adding tests for various broker cache scenarios will benefit from this test framework improvement.

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.

Modifications

Add PulsarMockReadHandleInterceptor interface and implement it in PulsarMockBookKeeper.

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@lhotari
Add solution to PulsarMockBookKeeper for intercepting reads
c937b12
@lhotari lhotari added release/3.0.10 release/4.0.3 labels Jan 22, 2025
@lhotari lhotari added this to the 4.1.0 milestone Jan 22, 2025
@lhotari
lhotari requested a review from poorbarcode January 22, 2025 07:54
@lhotari lhotari self-assigned this Jan 22, 2025
@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label Jan 22, 2025
@lhotari lhotari added the ready-to-test label Jan 22, 2025
@lhotari lhotari mentioned this pull request Jan 22, 2025
[fix][broker] PIP-379 Key_Shared implementation race condition causing out-of-order message delivery #23874
Merged
1 of 4 tasks
@lhotari
lhotari requested review from Technoboy-, dao-jun, eolivelli, nicoloboschi, nodece, shibd and thetumbled January 22, 2025 08:06
@codecov-commenter

codecov-commenter commented Jan 22, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.16%. Comparing base (bbc6224) to head (c937b12).
Report is 861 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #23875      +/-   ##
============================================
+ Coverage     73.57%   74.16%   +0.58%     
+ Complexity    32624    31815     -809     
============================================
  Files          1877     1853      -24     
  Lines        139502   143619    +4117     
  Branches      15299    16311    +1012     
============================================
+ Hits         102638   106509    +3871     
+ Misses        28908    28727     -181     
- Partials       7956     8383     +427     
Flag Coverage Δ
inttests 26.81% <ø> (+2.23%) ⬆️
systests 23.18% <ø> (-1.14%) ⬇️
unittests 73.66% <ø> (+0.81%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1031 files with indirect coverage changes

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

pdolif
pdolif approved these changes Jan 22, 2025
View reviewed changes
Technoboy-
Technoboy- approved these changes Jan 23, 2025
View reviewed changes
@lhotari
lhotari merged commit 87fb442 into apache:master Jan 23, 2025
@lhotari lhotari mentioned this pull request Jan 23, 2025
[fix][broker] Fix repeatedly acquired pending reads quota #23869
Merged
1 of 4 tasks
lhotari added a commit that referenced this pull request Jan 23, 2025
@lhotari
[improve][test] Add solution to PulsarMockBookKeeper for intercepting…
ee4e630
… reads (#23875)

(cherry picked from commit 87fb442)
@lhotari lhotari added the cherry-picked/branch-4.0 label Jan 23, 2025
lhotari added a commit that referenced this pull request Jan 23, 2025
@lhotari
[improve][test] Add solution to PulsarMockBookKeeper for intercepting…
38f15bc
… reads (#23875)

(cherry picked from commit 87fb442)
@lhotari lhotari added cherry-picked/branch-3.0 release/3.3.5 labels Jan 23, 2025
lhotari added a commit that referenced this pull request Jan 23, 2025
@lhotari
[improve][test] Add solution to PulsarMockBookKeeper for intercepting…
0a14792
… reads (#23875)

(cherry picked from commit 87fb442)
@lhotari lhotari added the cherry-picked/branch-3.3 label Jan 23, 2025
@lhotari lhotari mentioned this pull request Jan 28, 2025
[fix][broker Fix bug in RangeCache where different instance of the key wouldn't ever match #23903
Merged
1 of 4 tasks
nikhil-ctds pushed a commit to datastax/pulsar that referenced this pull request Jan 31, 2025
@lhotari @nikhil-ctds
[improve][test] Add solution to PulsarMockBookKeeper for intercepting…
30e25e8
… reads (apache#23875)

(cherry picked from commit 87fb442)
(cherry picked from commit 38f15bc)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Feb 3, 2025
@lhotari @srinath-ctds
[improve][test] Add solution to PulsarMockBookKeeper for intercepting…
094f1ba
… reads (apache#23875)

(cherry picked from commit 87fb442)
(cherry picked from commit 38f15bc)
nodece pushed a commit to ascentstream/pulsar that referenced this pull request Feb 10, 2025
@lhotari @nodece
[improve][test] Add solution to PulsarMockBookKeeper for intercepting…
49bb81f
… reads (apache#23875)

(cherry picked from commit 87fb442)
hanmz pushed a commit to hanmz/pulsar that referenced this pull request Feb 12, 2025
@lhotari hanmz
[improve][test] Add solution to PulsarMockBookKeeper for intercepting…
33d7c14
… reads (apache#23875)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Technoboy- Technoboy- Technoboy- approved these changes
@poorbarcode poorbarcode Awaiting requested review from poorbarcode
@nodece nodece Awaiting requested review from nodece
@dao-jun dao-jun Awaiting requested review from dao-jun
@shibd shibd Awaiting requested review from shibd
@eolivelli eolivelli Awaiting requested review from eolivelli
@nicoloboschi nicoloboschi Awaiting requested review from nicoloboschi
@thetumbled thetumbled Awaiting requested review from thetumbled
+1 more reviewer
@pdolif pdolif pdolif approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@lhotari lhotari

Labels

cherry-picked/branch-3.0 cherry-picked/branch-3.3 cherry-picked/branch-4.0 doc-not-needed Your PR changes do not impact docs ready-to-test release/3.0.10 release/3.3.5 release/4.0.3

Projects

None yet

Milestone

4.1.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@lhotari @codecov-commenter @Technoboy- @pdolif
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.