Repository navigation
[fix][flaky] Fix flakyness in testAutoSchemaFunction - #17353
Merged
Merged
Conversation
Contributor
Author
|
I hope it fixes the CI. Not totally sure about that. At least it now works on my machine... |
cbornet
force-pushed
the
fix-testAutoSchemaFunction
branch
from
August 30, 2022 16:55
cfc7867 to
7f67508
Compare
cbornet
requested review from
eolivelli
and removed request for
dlg99,
lhotari,
nicoloboschi and
zymap
August 30, 2022 16:56
eolivelli
approved these changes
Aug 30, 2022
nicoloboschi
approved these changes
Aug 30, 2022
…before the function. Otherwise if the function creates the subscription, there is no schema on the topic and because of a bug a compatibility check fails on the new schema and the new consumer can't be creatd
cbornet
force-pushed
the
fix-testAutoSchemaFunction
branch
from
August 31, 2022 06:57
7f67508 to
6c59956
Compare
lhotari
approved these changes
Aug 31, 2022
Technoboy-
pushed a commit
to Technoboy-/pulsar
that referenced
this pull request
Feb 8, 2023
…before the function. (apache#17353) Otherwise if the function creates the subscription, there is no schema on the topic and because of a bug a compatibility check fails on the new schema and the new consumer can't be creatd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
testAutoSchemaFunctionis flaky becauseensureSubscriptionCreatedwill create a consumer to create the subscription.By doing so it also adds a schema on the topic.
But that leads to a race when the function consumer uses AUTO_SCHEMA because the new schema is seen as incompatible if the function consumer is already subscribed (We get IncompatibleSchemaException : Topic does not have schema to check).
Note: the issue with the IncompatibleSchemaException is a bug and will be fixed in another PR (see issue #17354)
Modifications
Move the call to
ensureSubscriptionCreatedbefore creating the function.Verifying this change
This change is already covered by existing tests, such as
PulsarFunctionsTestDoes this pull request potentially affect one of the following parts:
no
If
yeswas chosen, please highlight the changesDocumentation
Check the box below or label this PR directly.
Need to update docs?
doc-required(Your PR needs to update docs and you will update later)
doc-not-neededfix
doc(Your PR contains doc changes)
doc-complete(Docs have been already added)