From 612e042538c68e14a7edb725efad6628d263672c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Boschi?= Date: Mon, 7 Mar 2022 18:00:57 +0100 Subject: [PATCH] [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) (cherry picked from commit 0f72a4ff1f21ecf9815290a78be2ab2ea48cecc7) --- .../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 8bcfc774c1748..5aa24628b2a35 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,8 +707,7 @@ 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.INT32.clone(); + final Schema integerSchema = Schema.JSON(Integer.class); ((SchemaInfoImpl) integerSchema.getSchemaInfo()).setProperties(map); final Consumer consumer = pulsarClient.newConsumer(integerSchema).topic(topic)