You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "Bhargavkonidena (via GitHub)" <gi...@apache.org> on 2025/05/21 08:32:45 UTC
[PR] [Fix][test] Checkstyle check is not applied to all tests [pulsar]
Bhargavkonidena opened a new pull request, #24326:
URL: https://github.com/apache/pulsar/pull/24326
Fixes #23079
*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
### Documentation
- [ ] `doc` <!-- Your PR contains doc changes. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
PR in forked repository: <!-- ENTER URL HERE -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][test] Checkstyle check is not applied to all tests [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari closed pull request #24326: [Fix][test] Checkstyle check is not applied to all tests
URL: https://github.com/apache/pulsar/pull/24326
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][test] Checkstyle check is not applied to all tests [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on code in PR #24326:
URL: https://github.com/apache/pulsar/pull/24326#discussion_r2099839834
##########
pulsar-broker/src/test/java/org/apache/bookkeeper/mledger/impl/ConsumerUnsubscribeIntegrationTest.java:
##########
@@ -1,84 +1,89 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.bookkeeper.mledger.impl;
-
-import static org.testng.Assert.assertEquals;
-import java.util.concurrent.TimeUnit;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.pulsar.broker.BrokerTestUtil;
-import org.apache.pulsar.broker.service.persistent.PersistentTopic;
-import org.apache.pulsar.client.api.Consumer;
-import org.apache.pulsar.client.api.MessageId;
-import org.apache.pulsar.client.api.Producer;
-import org.apache.pulsar.client.api.ProducerConsumerBase;
-import org.apache.pulsar.client.api.Schema;
-import org.awaitility.Awaitility;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-@Slf4j
-@Test(groups = "broker-impl")
-public class ConsumerUnsubscribeIntegrationTest extends ProducerConsumerBase {
-
- @BeforeClass(alwaysRun = true)
- @Override
- protected void setup() throws Exception {
- super.internalSetup();
- super.producerBaseSetup();
- }
-
- @AfterClass(alwaysRun = true)
- @Override
- protected void cleanup() throws Exception {
- super.internalCleanup();
- }
-
- @Test
- public void testUnSubscribeWhenCursorNotExists() throws Exception {
- final String topic = BrokerTestUtil.newUniqueName("persistent://public/default/tp");
- final String subscription = "s1";
- admin.topics().createNonPartitionedTopic(topic);
- admin.topics().createSubscription(topic, subscription, MessageId.earliest);
-
- Producer<String> producer = pulsarClient.newProducer(Schema.STRING).topic(topic).create();
- Consumer<String> consumer = pulsarClient.newConsumer(Schema.STRING).topic(topic).subscriptionName(subscription)
- .subscribe();
-
- producer.send("1");
- consumer.acknowledge(consumer.receive(2, TimeUnit.SECONDS));
-
- PersistentTopic persistentTopic =
- (PersistentTopic) pulsar.getBrokerService().getTopic(topic, false).join().get();
- ManagedLedgerImpl ml = (ManagedLedgerImpl) persistentTopic.getManagedLedger();
- ManagedCursorImpl cursor = (ManagedCursorImpl) ml.getCursors().get(subscription);
- Awaitility.await().untilAsserted(() -> {
- assertEquals(ManagedCursorImpl.State.Open, cursor.state);
- });
-
- // Verify: unsubscribe will succeed if the cursor was already removed.
- ml.deleteCursor(subscription);
- consumer.unsubscribe();
-
- // cleanup
- producer.close();
- consumer.close();
- admin.topics().delete(topic, false);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.bookkeeper.mledger.impl;
+
+import static org.testng.Assert.assertEquals;
+
+import java.util.concurrent.TimeUnit;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.pulsar.broker.BrokerTestUtil;
+import org.apache.pulsar.broker.service.persistent.PersistentTopic;
+import org.apache.pulsar.client.api.Consumer;
+import org.apache.pulsar.client.api.MessageId;
+import org.apache.pulsar.client.api.Producer;
+import org.apache.pulsar.client.api.ProducerConsumerBase;
+import org.apache.pulsar.client.api.Schema;
+import org.awaitility.Awaitility;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+@Slf4j
+@Test(groups = "broker-impl")
+public class ConsumerUnsubscribeIntegrationTest extends ProducerConsumerBase {
+
+ @BeforeClass(alwaysRun = true)
+ @Override
+ protected void setup() throws Exception {
+ super.internalSetup();
+ super.producerBaseSetup();
+ }
+
+ @AfterClass(alwaysRun = true)
+ @Override
+ protected void cleanup() throws Exception {
+ super.internalCleanup();
+ }
+
+ @Test
+ public void testUnSubscribeWhenCursorNotExists() throws Exception {
+ final String topic = BrokerTestUtil.newUniqueName("persistent://public/default/tp");
+ final String subscription = "s1";
+ admin.topics().createNonPartitionedTopic(topic);
+ admin.topics().createSubscription(topic, subscription, MessageId.earliest);
+
+ Producer<String> producer = pulsarClient.newProducer(Schema.STRING).topic(topic).create();
+ Consumer<String> consumer = pulsarClient
+ .newConsumer(Schema.STRING)
+ .topic(topic)
+ .subscriptionName(subscription)
+ .subscribe();
+
+ producer.send("1");
+ consumer.acknowledge(consumer.receive(2, TimeUnit.SECONDS));
+
+ PersistentTopic persistentTopic = (PersistentTopic) pulsar.getBrokerService().getTopic(topic, false).join().get();
+ ManagedLedgerImpl ml = (ManagedLedgerImpl) persistentTopic.getManagedLedger();
+ ManagedCursorImpl cursor = (ManagedCursorImpl) ml.getCursors().get(subscription);
+ Awaitility.await()
+ .untilAsserted(
+ () -> {
+ assertEquals(ManagedCursorImpl.State.Open, cursor.state);
+ });
+
+ // Verify: unsubscribe will succeed if the cursor was already removed.
+ ml.deleteCursor(subscription);
+ consumer.unsubscribe();
+
+ // cleanup
+ producer.close();
+ consumer.close();
+ admin.topics().delete(topic, false);
+ }
Review Comment:
The whole code base shouldn't be reformatted. That would cause problems for maintenance with merge conflicts. Only change the lines that violate the checkstyle checks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][test] Checkstyle check is not applied to all tests [pulsar]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #24326:
URL: https://github.com/apache/pulsar/pull/24326#issuecomment-2897084870
@Bhargavkonidena Please add the following content to your PR description and select a checkbox:
```
- [ ] `doc` <!-- Your PR contains doc changes -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][test] Checkstyle check is not applied to all tests [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on PR #24326:
URL: https://github.com/apache/pulsar/pull/24326#issuecomment-2897599366
Closing this PR since this change is not good and the issue #23079 is assigned to @Praveen7294 currently.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][test] Checkstyle check is not applied to all tests [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on code in PR #24326:
URL: https://github.com/apache/pulsar/pull/24326#discussion_r2099837289
##########
pulsar-broker/src/test/java/org/apache/bookkeeper/mledger/impl/ConsumerUnsubscribeIntegrationTest.java:
##########
@@ -1,84 +1,89 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.bookkeeper.mledger.impl;
-
-import static org.testng.Assert.assertEquals;
-import java.util.concurrent.TimeUnit;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.pulsar.broker.BrokerTestUtil;
-import org.apache.pulsar.broker.service.persistent.PersistentTopic;
-import org.apache.pulsar.client.api.Consumer;
-import org.apache.pulsar.client.api.MessageId;
-import org.apache.pulsar.client.api.Producer;
-import org.apache.pulsar.client.api.ProducerConsumerBase;
-import org.apache.pulsar.client.api.Schema;
-import org.awaitility.Awaitility;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-@Slf4j
-@Test(groups = "broker-impl")
-public class ConsumerUnsubscribeIntegrationTest extends ProducerConsumerBase {
-
- @BeforeClass(alwaysRun = true)
- @Override
- protected void setup() throws Exception {
- super.internalSetup();
- super.producerBaseSetup();
- }
-
- @AfterClass(alwaysRun = true)
- @Override
- protected void cleanup() throws Exception {
- super.internalCleanup();
- }
-
- @Test
- public void testUnSubscribeWhenCursorNotExists() throws Exception {
- final String topic = BrokerTestUtil.newUniqueName("persistent://public/default/tp");
- final String subscription = "s1";
- admin.topics().createNonPartitionedTopic(topic);
- admin.topics().createSubscription(topic, subscription, MessageId.earliest);
-
- Producer<String> producer = pulsarClient.newProducer(Schema.STRING).topic(topic).create();
- Consumer<String> consumer = pulsarClient.newConsumer(Schema.STRING).topic(topic).subscriptionName(subscription)
- .subscribe();
-
- producer.send("1");
- consumer.acknowledge(consumer.receive(2, TimeUnit.SECONDS));
-
- PersistentTopic persistentTopic =
- (PersistentTopic) pulsar.getBrokerService().getTopic(topic, false).join().get();
- ManagedLedgerImpl ml = (ManagedLedgerImpl) persistentTopic.getManagedLedger();
- ManagedCursorImpl cursor = (ManagedCursorImpl) ml.getCursors().get(subscription);
- Awaitility.await().untilAsserted(() -> {
- assertEquals(ManagedCursorImpl.State.Open, cursor.state);
- });
-
- // Verify: unsubscribe will succeed if the cursor was already removed.
- ml.deleteCursor(subscription);
- consumer.unsubscribe();
-
- // cleanup
- producer.close();
- consumer.close();
- admin.topics().delete(topic, false);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.bookkeeper.mledger.impl;
+
+import static org.testng.Assert.assertEquals;
+
Review Comment:
This doesn't look write. The code style in Pulsar doesn't have a blank line between imports.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][test] Checkstyle check is not applied to all tests [pulsar]
Posted by "Praveen7294 (via GitHub)" <gi...@apache.org>.
Praveen7294 commented on PR #24326:
URL: https://github.com/apache/pulsar/pull/24326#issuecomment-2897619215
@lhotari thanks i am already working on it, there are 3000+ checkstyle rule violations in broker module only and i have my final year exam coming so i am not able to give so much time to it after my exam i will give my full potential to it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][test] Checkstyle check is not applied to all tests [pulsar]
Posted by "Bhargavkonidena (via GitHub)" <gi...@apache.org>.
Bhargavkonidena commented on PR #24326:
URL: https://github.com/apache/pulsar/pull/24326#issuecomment-2897086085
[out.log](https://github.com/user-attachments/files/20363921/out.log)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][test] Checkstyle check is not applied to all tests [pulsar]
Posted by "Praveen7294 (via GitHub)" <gi...@apache.org>.
Praveen7294 commented on PR #24326:
URL: https://github.com/apache/pulsar/pull/24326#issuecomment-2897144385
i guess it does not fixes any checkstyle bug.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org