fresh-borzoni commented on code in PR #434:
URL: https://github.com/apache/fluss-rust/pull/434#discussion_r2901593930


##########
bindings/cpp/test/test_utils.h:
##########
@@ -126,29 +126,42 @@ class FlussTestCluster {
         const char* env_servers = std::getenv("FLUSS_BOOTSTRAP_SERVERS");
         if (env_servers && std::strlen(env_servers) > 0) {
             bootstrap_servers_ = env_servers;
+            const char* env_sasl = std::getenv("FLUSS_SASL_BOOTSTRAP_SERVERS");
+            if (env_sasl && std::strlen(env_sasl) > 0) {
+                sasl_bootstrap_servers_ = env_sasl;

Review Comment:
   SASL tests require a dedicated listener with auth config; defaulting to 
plain bootstrap would silently connect without SASL. Not applicable here.



##########
bindings/cpp/test/test_utils.h:
##########
@@ -126,29 +126,42 @@ class FlussTestCluster {
         const char* env_servers = std::getenv("FLUSS_BOOTSTRAP_SERVERS");
         if (env_servers && std::strlen(env_servers) > 0) {
             bootstrap_servers_ = env_servers;
+            const char* env_sasl = std::getenv("FLUSS_SASL_BOOTSTRAP_SERVERS");
+            if (env_sasl && std::strlen(env_sasl) > 0) {
+                sasl_bootstrap_servers_ = env_sasl;
+            }
             external_cluster_ = true;
             std::cout << "Using external cluster: " << bootstrap_servers_ << 
std::endl;
             return true;
         }
 
+        // Reuse cluster started by another parallel test process or previous 
run.
+        if (WaitForPort("127.0.0.1", kPlainClientPort, /*timeout_seconds=*/1)) 
{
+            SetBootstrapServers();
+            external_cluster_ = true;
+            return true;
+        }

Review Comment:
   The 1s probe is just a quick "is anything there?" check. If it responds, the 
cluster is already fully booted by another process. If not, falls through to 
full Docker startup which waits on all 4 ports. No race here.



##########
bindings/cpp/test/test_utils.h:
##########
@@ -291,7 +316,8 @@ class FlussTestEnvironment : public ::testing::Environment {
         GTEST_SKIP() << "Fluss cluster did not become ready within timeout.";
     }
 
-    void TearDown() override { cluster_.Stop(); }
+    // Cluster stays alive for parallel processes and subsequent runs.
+    void TearDown() override {}

Review Comment:
   Intentional: parallel processes must not kill the cluster mid-suite. Cleanup 
is handled by the ctest FIXTURES_CLEANUP hook (--cleanup → StopAll). Leftover 
containers from direct runs are cleaned at the start of Start().



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