This is an automated email from the ASF dual-hosted git repository. alexey pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/kudu.git
commit c2003752ea9aefaec3e2414abcc23ed05e3de0dd Author: Alexey Serbin <[email protected]> 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 <[email protected]> Tested-by: Alexey Serbin <[email protected]> --- 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 e20ec51d7..fd11086a8 100644 --- a/src/kudu/tserver/tablet_server-test.cc +++ b/src/kudu/tserver/tablet_server-test.cc @@ -1017,6 +1017,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> {
