This is an automated email from the ASF dual-hosted git repository.

alexey pushed a commit to branch branch-1.17.x
in repository https://gitbox.apache.org/repos/asf/kudu.git


The following commit(s) were added to refs/heads/branch-1.17.x by this push:
     new 2a5fdab03 [tests] fix failing TestWebUIDoesNotCrashCluster
2a5fdab03 is described below

commit 2a5fdab0329982085d18182fe354ef8d5861f17b
Author: Alexey Serbin <ale...@apache.org>
AuthorDate: Fri Sep 27 14:22:35 2024 -0700

    [tests] fix failing TestWebUIDoesNotCrashCluster
    
    Before this patch, the TestWebUIDoesNotCrashCluster scenario of the
    webserver-stress-itest was failing if running in an environment where
    KUDU_HOME was set and pointed to the correct location of the Kudu
    git workspace.  Also, the webserver-stress-itest didn't look like a good
    place for such a test.
    
    This is a follow-up to b2514b98c7639c2a328a4dddd8fd9213428b0d4d.
    
    Change-Id: I59b6ef64b522540620bdc622156b3516ada23f5d
    Reviewed-on: http://gerrit.cloudera.org:8080/21863
    Reviewed-by: Abhishek Chennaka <achenn...@cloudera.com>
    Tested-by: Alexey Serbin <ale...@apache.org>
    (cherry picked from commit c2003752ea9aefaec3e2414abcc23ed05e3de0dd)
    Reviewed-on: http://gerrit.cloudera.org:8080/21868
    Tested-by: Marton Greber <greber...@gmail.com>
    Reviewed-by: Marton Greber <greber...@gmail.com>
---
 src/kudu/integration-tests/webserver-stress-itest.cc | 16 ----------------
 src/kudu/tserver/tablet_server-test.cc               | 12 ++++++++++++
 2 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/src/kudu/integration-tests/webserver-stress-itest.cc 
b/src/kudu/integration-tests/webserver-stress-itest.cc
index bf588df67..7a5b6df92 100644
--- a/src/kudu/integration-tests/webserver-stress-itest.cc
+++ b/src/kudu/integration-tests/webserver-stress-itest.cc
@@ -19,23 +19,17 @@
 #include <string>
 #include <vector>
 
-#include <glog/logging.h>
 #include <gtest/gtest.h>
 
-#include "kudu/gutil/strings/substitute.h"
 #include "kudu/integration-tests/test_workload.h"
 #include "kudu/mini-cluster/external_mini_cluster.h"
 #include "kudu/mini-cluster/webui_checker.h"
-#include "kudu/util/curl_util.h"
-#include "kudu/util/faststring.h"
-#include "kudu/util/net/net_util.h"
 #include "kudu/util/monotime.h"
 #include "kudu/util/test_macros.h"
 #include "kudu/util/test_util.h"
 
 using kudu::cluster::ExternalMiniCluster;
 using kudu::cluster::ExternalMiniClusterOptions;
-using std::string;
 using std::unique_ptr;
 using std::vector;
 
@@ -98,16 +92,6 @@ TEST_F(KuduTest, TestWebUIDoesNotCrashCluster) {
   }
   SleepFor(MonoDelta::FromSeconds(5));
 
-  {
-    EasyCurl curl;
-    string web_url =
-        strings::Substitute("http://$0//maintenance-manager";,
-                            
cluster.tablet_server(0)->bound_http_hostport().ToString());
-    faststring buf;
-    curl.FetchURL(web_url, &buf);
-    ASSERT_STR_CONTAINS(buf.ToString(), "data_retained");
-  }
-
   work.StopAndJoin();
 
   // Restart the cluster.
diff --git a/src/kudu/tserver/tablet_server-test.cc 
b/src/kudu/tserver/tablet_server-test.cc
index a51549381..5c9246be8 100644
--- a/src/kudu/tserver/tablet_server-test.cc
+++ b/src/kudu/tserver/tablet_server-test.cc
@@ -992,6 +992,18 @@ TEST_F(TabletServerStartupWebPageTest, 
TestLogBlockContainerMetrics) {
   }
 }
 
+class TabletServerMaintenanceManagerWebPageTest: public 
TabletServerStartupWebPageTest {
+};
+
+TEST_F(TabletServerMaintenanceManagerWebPageTest, OpDataRetainedStats) {
+  mini_server_->WaitStarted();
+
+  faststring buf;
+  ASSERT_OK(EasyCurl().FetchURL(Substitute("http://$0/maintenance-manager";,
+                                           
mini_server_->bound_http_addr().ToString()),
+                                &buf));
+  ASSERT_STR_CONTAINS(buf.ToString(), "data_retained");
+}
 
 class TabletServerDiskErrorTest : public TabletServerTestBase,
                                   public 
testing::WithParamInterface<ErrorType> {

Reply via email to