arunsingh commented on code in PR #3377:
URL: https://github.com/apache/iggy/pull/3377#discussion_r3341497010


##########
core/integration/tests/connectors/random/random_source.rs:
##########
@@ -17,79 +17,33 @@
  * under the License.
  */
 
-use iggy_common::MessageClient;
-use iggy_common::{Consumer, Identifier, PollingStrategy};
+use crate::connectors::source_suite;
 use integration::harness::seeds;
 use integration::iggy_harness;
-use std::time::Duration;
-use tokio::time::sleep;
 
 #[iggy_harness(
     server(connectors_runtime(config_path = 
"tests/connectors/random/source.toml")),
     seed = seeds::connector_stream
 )]
 async fn random_source_produces_messages(harness: &TestHarness) {
-    sleep(Duration::from_secs(1)).await;
-
-    let client = harness.root_client().await.unwrap();
-    let stream_id: Identifier = seeds::names::STREAM.try_into().unwrap();
-    let topic_id: Identifier = seeds::names::TOPIC.try_into().unwrap();
-    let consumer_id: Identifier = "test_consumer".try_into().unwrap();
-
-    let messages = client
-        .poll_messages(
-            &stream_id,
-            &topic_id,
-            None,
-            &Consumer::new(consumer_id),
-            &PollingStrategy::next(),
-            10,
-            true,
-        )
-        .await
-        .expect("Failed to poll messages");
-
+    let messages = 
source_suite::assert_source_produces_messages(harness).await;
     assert!(
-        !messages.messages.is_empty(),
+        !messages.is_empty(),
         "No messages received from random source"
     );
-    assert!(
-        messages.current_offset > 0,
-        "Current offset should be greater than 0"
-    );
 }
 
 #[iggy_harness(
     server(connectors_runtime(config_path = 
"tests/connectors/random/source.toml")),
     seed = seeds::connector_stream
 )]
 async fn state_persists_across_connector_restart(harness: &mut TestHarness) {

Review Comment:
   Dropped the random restart test; random now stays as liveness smoke only.



##########
core/integration/tests/connectors/random/random_source.rs:
##########
@@ -17,79 +17,33 @@
  * under the License.
  */
 
-use iggy_common::MessageClient;
-use iggy_common::{Consumer, Identifier, PollingStrategy};
+use crate::connectors::source_suite;
 use integration::harness::seeds;
 use integration::iggy_harness;
-use std::time::Duration;
-use tokio::time::sleep;
 
 #[iggy_harness(
     server(connectors_runtime(config_path = 
"tests/connectors/random/source.toml")),
     seed = seeds::connector_stream
 )]
 async fn random_source_produces_messages(harness: &TestHarness) {
-    sleep(Duration::from_secs(1)).await;
-
-    let client = harness.root_client().await.unwrap();
-    let stream_id: Identifier = seeds::names::STREAM.try_into().unwrap();
-    let topic_id: Identifier = seeds::names::TOPIC.try_into().unwrap();
-    let consumer_id: Identifier = "test_consumer".try_into().unwrap();
-
-    let messages = client
-        .poll_messages(
-            &stream_id,
-            &topic_id,
-            None,
-            &Consumer::new(consumer_id),
-            &PollingStrategy::next(),
-            10,
-            true,
-        )
-        .await
-        .expect("Failed to poll messages");
-
+    let messages = 
source_suite::assert_source_produces_messages(harness).await;
     assert!(

Review Comment:
   Removed the duplicate assertion and call the helper directly.



-- 
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