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 — [fix][test] Fix flaky SchemaCompatibilityCheckTest.testIsAutoUpdateSchema by lhotari · Pull Request #27656 · apache/pulsar

Conversation

@lhotari

@lhotari lhotari commented Nov 17, 2026

Copy link
Copy Markdown
Member

Motivation

SchemaCompatibilityCheckTest.testIsAutoUpdateSchema is flaky. In this CI run it failed on both attempts with:

PulsarClientException$IncompatibleSchemaException: Schema not found and schema auto updating is disabled.
    at org.apache.pulsar.schema.compatibility.SchemaCompatibilityCheckTest.testIsAutoUpdateSchema(SchemaCompatibilityCheckTest.java:354)

The test turns off auto schema updates for the namespace, checks that a producer with a new schema is rejected, then calls admin.namespaces().setIsAllowAutoUpdateSchema(ns, true, true) and immediately creates the producer again, expecting it to succeed. The admin call returns once the policy is stored. However, the broker applies namespace policies to topics that are already loaded asynchronously: BrokerService.handlePoliciesUpdates → PersistentTopic.onPoliciesUpdate. The topic is already loaded at this point, because the earlier, rejected producer loaded it. Until the update arrives, AbstractTopic.allowAutoUpdateSchema still sees false and rejects the schema.

Modifications

  • Create the producer that follows setIsAllowAutoUpdateSchema(..., true, ...) inside Awaitility, ignoring only IncompatibleSchemaException. The test now waits until the policy has reached the topic. The rest of the test, including all assertions, is unchanged.

Verifying this change

  • Make sure that the change passes the CI checks.

This change is already covered by existing tests, such as SchemaCompatibilityCheckTest.testIsAutoUpdateSchema. Verified locally:

  • With a temporary 1 s delay injected before onPoliciesUpdate in BrokerService, the original test failed for all 6 strategies with the same error as in CI. The fixed test passed for all 6.
  • Without the delay, the whole class passed with invocationCount = 10 on this method (87/87 tests).

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

Sorry, something went wrong.

Uh oh!

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

All reactions
@lhotari
[fix][test] Wait for the namespace auto-update-schema policy to reach…
f121047
… the topic in SchemaCompatibilityCheckTest.testIsAutoUpdateSchema

Assisted-by: Claude Code (claude-opus-5-5)
@lhotari
lhotari requested review from Denovo1998, Technoboy-, codelipenghui, dao-jun, merlimat and nodece November 17, 2026 23:50
Denovo1998
Denovo1998 approved these changes Nov 18, 2026
View reviewed changes
codelipenghui
codelipenghui approved these changes Nov 18, 2026
View reviewed changes
@merlimat
merlimat merged commit 51b011a into apache:master Nov 18, 2026
43 checks passed

Uh oh!

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

lhotari added a commit that referenced this pull request Nov 19, 2026
@lhotari
[fix][test] Fix flaky SchemaCompatibilityCheckTest.testIsAutoUpdateSc…
21eea9f
…hema (#27656)

(cherry picked from commit 51b011a)
@lhotari lhotari added release/5.0.2 cherry-picked/branch-5.0 labels Nov 19, 2026
This was referenced Nov 21, 2026
[improve][ci] Run CI for the 4.2.6 backports to branch-4.2 (do not merge) #27680
Closed
[improve][ci] Run CI for the 4.2.6 backports to branch-4.2 (do not merge) #27681
Closed
[improve][ci] Run CI for the 4.2.6 backports to branch-4.2 (do not merge) #27684
Closed
@lhotari lhotari added cherry-picked/branch-4.2 release/4.2.6 cherry-picked/branch-4.0 release/4.0.15 labels Nov 21, 2026
poorbarcode pushed a commit to poorbarcode/pulsar that referenced this pull request Nov 26, 2026
@lhotari
[fix][test] Fix flaky SchemaCompatibilityCheckTest.testIsAutoUpdateSc…
122cc92
…hema (apache#27656)

(cherry picked from commit 51b011a)
poorbarcode pushed a commit to poorbarcode/pulsar that referenced this pull request Nov 26, 2026
@lhotari
[fix][test] Fix flaky SchemaCompatibilityCheckTest.testIsAutoUpdateSc…
3926ef9
…hema (apache#27656)

(cherry picked from commit 51b011a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@codelipenghui codelipenghui codelipenghui approved these changes
@Denovo1998 Denovo1998 Denovo1998 approved these changes
@merlimat merlimat Awaiting requested review from merlimat
@nodece nodece Awaiting requested review from nodece
@dao-jun dao-jun Awaiting requested review from dao-jun
@Technoboy- Technoboy- Awaiting requested review from Technoboy-

Uh oh!

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

Assignees

No one assigned

Labels

cherry-picked/branch-4.0 cherry-picked/branch-4.2 cherry-picked/branch-5.0 release/4.0.15 release/4.2.6 release/5.0.2

Projects

None yet

Milestone

No milestone

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 @codelipenghui @Denovo1998 @merlimat
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.