slbotbm commented on code in PR #3608:
URL: https://github.com/apache/iggy/pull/3608#discussion_r3839638303


##########
bdd/scenarios/stream_topic_purge.feature:
##########
@@ -0,0 +1,76 @@
+# 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.
+
+@stream-topic-purge
+Feature: Stream and Topic Purge
+  As a developer using Apache Iggy
+  I want to purge all messages from a stream or topic
+  So that I can clear data without deleting the resource
+
+  Background:
+    Given I have a running Iggy server
+    And I am authenticated as the root user
+
+  Scenario: Purge stream removes all messages
+    Given I have a stream with name "purge-test-stream"
+    And I have a topic with name "purge-topic" in stream "purge-test-stream" 
with 3 partitions
+    And I have sent 10 messages to stream "purge-test-stream", topic 
"purge-topic", partition 0
+    When I purge the stream "purge-test-stream"
+    And I poll messages from stream "purge-test-stream", topic "purge-topic", 
partition 0 starting from offset 0
+    Then I should receive 0 messages

Review Comment:
   Could we wait for purge convergence before polling here? The purge command 
commits a new purge generation, but the partition reconciler clears the 
messages on a later tick. This immediate poll can therefore still see pre-purge 
data and make this scenario flaky (faced this while writing tests for cpp). 
Consider adding bounded retry/wait logic before asserting the message count. 
The same applies to the other immediate post-purge polls in this feature.



##########
scripts/run-bdd-tests.sh:
##########


Review Comment:
   The script accepts `stream_topic_purge` as a feature, but `run_suite` does 
not define which SDKs support it. Consequently, `./scripts/run-bdd-tests.sh all 
stream_topic_purge` also invokes every other SDK. Those SDKs fall back to their 
default commands, which run unrelated full suites and can report success 
without exercising this feature. Let's restrict this feature to the Rust and Go 
BDD services, as the script already does for other SDK-specific features.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to