From e89081de33d8adc63b17c32db2497d0705640046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Boschi?= Date: Tue, 1 Mar 2022 12:28:08 +0100 Subject: [PATCH 1/3] [flaky-tests] AdminApiSchemaTest#testSchemaInfoApi --- .../src/test/java/org/apache/pulsar/schema/SchemaTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 5c8336116a593..7e363753f39ec 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 @@ -67,6 +67,7 @@ import org.apache.pulsar.client.impl.schema.SchemaInfoImpl; import org.apache.pulsar.client.impl.schema.generic.GenericJsonRecord; import org.apache.pulsar.client.impl.schema.writer.AvroWriter; +import org.apache.pulsar.client.internal.DefaultImplementation; import org.apache.pulsar.common.naming.TopicDomain; import org.apache.pulsar.common.naming.TopicName; import org.apache.pulsar.common.policies.data.ClusterData; @@ -708,7 +709,7 @@ public void testNullKeyValueProperty() throws PulsarAdminException, PulsarClient map.put(null, "value"); // null key is not allowed for JSON, it's only for test here // leave INT32 instance unchanged - final Schema integerSchema = Schema.INT32.clone(); + final Schema integerSchema = DefaultImplementation.getDefaultImplementation().newIntSchema(); ((SchemaInfoImpl) integerSchema.getSchemaInfo()).setProperties(map); final Consumer consumer = pulsarClient.newConsumer(integerSchema).topic(topic) From 37fa21b4c67057e0b024f6b94ca021c16d2406dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Boschi?= Date: Tue, 1 Mar 2022 18:31:18 +0100 Subject: [PATCH 2/3] use custom json schema --- .../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 7e363753f39ec..009b1dc5c0095 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 @@ -67,7 +67,6 @@ import org.apache.pulsar.client.impl.schema.SchemaInfoImpl; import org.apache.pulsar.client.impl.schema.generic.GenericJsonRecord; import org.apache.pulsar.client.impl.schema.writer.AvroWriter; -import org.apache.pulsar.client.internal.DefaultImplementation; import org.apache.pulsar.common.naming.TopicDomain; import org.apache.pulsar.common.naming.TopicName; import org.apache.pulsar.common.policies.data.ClusterData; @@ -709,7 +708,7 @@ public void testNullKeyValueProperty() throws PulsarAdminException, PulsarClient map.put(null, "value"); // null key is not allowed for JSON, it's only for test here // leave INT32 instance unchanged - final Schema integerSchema = DefaultImplementation.getDefaultImplementation().newIntSchema(); + final Schema integerSchema = Schema.JSON(Integer.class); ((SchemaInfoImpl) integerSchema.getSchemaInfo()).setProperties(map); final Consumer consumer = pulsarClient.newConsumer(integerSchema).topic(topic) From 00d9c65c437ada7efbc1cf4a42bf386317b82df7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Boschi?= Date: Wed, 2 Mar 2022 08:43:14 +0100 Subject: [PATCH 3/3] remove old comment --- .../src/test/java/org/apache/pulsar/schema/SchemaTest.java | 1 - 1 file changed, 1 deletion(-) 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 009b1dc5c0095..3c6f7c73fbc9b 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 @@ -707,7 +707,6 @@ public void testNullKeyValueProperty() throws PulsarAdminException, PulsarClient 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 integerSchema = Schema.JSON(Integer.class); ((SchemaInfoImpl) integerSchema.getSchemaInfo()).setProperties(map);