You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by mm...@apache.org on 2022/03/07 17:55:07 UTC
[pulsar] 02/02: [flaky-tests] AdminApiSchemaTest#testSchemaInfoApi (#14508)
This is an automated email from the ASF dual-hosted git repository.
mmarshall pushed a commit to branch branch-2.9
in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit 597005bb6626d9980286e2f992cdbba83cf9081a
Author: Nicolò Boschi <bo...@gmail.com>
AuthorDate: Mon Mar 7 18:00:57 2022 +0100
[flaky-tests] AdminApiSchemaTest#testSchemaInfoApi (#14508)
* [flaky-tests] AdminApiSchemaTest#testSchemaInfoApi
* use custom json schema
* remove old comment
### Motivation
This is the same fix applied here #12461. The problem with the other pull is that the `AbstractSchema#clone()` method does return the same instance, so the fix is not useful at all.
I see this test also failing in 2.8 and 2.9 branch, I recommend to cherry-pick it.
### Modifications
* Create a new INT schema for the test purpose
- [x] `no-need-doc`
(cherry picked from commit 32c3cd1009eea884e0701143fe01dadf4556e73b)
---
pulsar-broker/src/test/java/org/apache/pulsar/schema/SchemaTest.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/schema/SchemaTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/schema/SchemaTest.java
index ff02c74..ab78988 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/schema/SchemaTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/schema/SchemaTest.java
@@ -659,8 +659,7 @@ public class SchemaTest extends MockedPulsarServiceBaseTest {
map.put("key", null);
map.put(null, "value"); // null key is not allowed for JSON, it's only for test here
- // leave INT32 instance unchanged
- final Schema<Integer> integerSchema = Schema.INT32.clone();
+ final Schema<Integer> integerSchema = Schema.JSON(Integer.class);
((SchemaInfoImpl) integerSchema.getSchemaInfo()).setProperties(map);
final Consumer<Integer> consumer = pulsarClient.newConsumer(integerSchema).topic(topic)