You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by al...@apache.org on 2019/10/15 17:18:02 UTC
[kudu] 05/08: [test] deflake memory_gc-itest
This is an automated email from the ASF dual-hosted git repository.
alexey pushed a commit to branch branch-1.11.x
in repository https://gitbox.apache.org/repos/asf/kudu.git
commit 8b7e9398a2e650b2bd22e489aaba30b2a0080c28
Author: Yingchun Lai <40...@qq.com>
AuthorDate: Tue Oct 15 10:44:09 2019 +0800
[test] deflake memory_gc-itest
Produce more rows for test table, and disable periodical tcmalloc
memory GC before main memory consuming for mini-tservers, to avoid
memory GC before we check it.
Change-Id: Ied3c38a0e40f0586e929f5102b99c1bf3a6a91c5
Reviewed-on: http://gerrit.cloudera.org:8080/14437
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <ad...@cloudera.com>
(cherry picked from commit 8d3d3784ff26292f4aedb4c3a7fc2303bc9958b0)
Reviewed-on: http://gerrit.cloudera.org:8080/14442
Reviewed-by: Yingchun Lai <40...@qq.com>
Reviewed-by: Alexey Serbin <as...@cloudera.com>
---
src/kudu/integration-tests/memory_gc-itest.cc | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/kudu/integration-tests/memory_gc-itest.cc b/src/kudu/integration-tests/memory_gc-itest.cc
index 761756f..eb9c963 100644
--- a/src/kudu/integration-tests/memory_gc-itest.cc
+++ b/src/kudu/integration-tests/memory_gc-itest.cc
@@ -67,13 +67,21 @@ class MemoryGcITest : public ExternalMiniClusterITestBase {
TEST_F(MemoryGcITest, TestPeriodicGc) {
vector<string> ts_flags;
// Set GC interval seconeds short enough, so the test case could compelte sooner.
- ts_flags.emplace_back("--gc_tcmalloc_memory_interval_seconds=1");
+ ts_flags.emplace_back("--gc_tcmalloc_memory_interval_seconds=5");
ExternalMiniClusterOptions opts;
opts.extra_tserver_flags = std::move(ts_flags);
opts.num_tablet_servers = 3;
NO_FATALS(StartClusterWithOpts(opts));
+ // Enable tcmalloc memory GC periodically for tserver-1, and disabled for tserver-0 and tserver-2.
+ ASSERT_OK(cluster_->SetFlag(cluster_->tablet_server(0),
+ "gc_tcmalloc_memory_interval_seconds", "0"));
+ ASSERT_OK(cluster_->SetFlag(cluster_->tablet_server(1),
+ "gc_tcmalloc_memory_interval_seconds", "1"));
+ ASSERT_OK(cluster_->SetFlag(cluster_->tablet_server(2),
+ "gc_tcmalloc_memory_interval_seconds", "0"));
+
// Write some data for scan later.
{
TestWorkload workload(cluster_.get());
@@ -84,19 +92,11 @@ TEST_F(MemoryGcITest, TestPeriodicGc) {
workload.Setup();
workload.Start();
ASSERT_EVENTUALLY([&]() {
- ASSERT_GE(workload.rows_inserted(), 10000);
+ ASSERT_GE(workload.rows_inserted(), 1000000);
});
workload.StopAndJoin();
}
- // Limit max overhead memory usage of tserver-1, and no limit for tserver-0 and tserver-2.
- ASSERT_OK(cluster_->SetFlag(cluster_->tablet_server(0),
- "tcmalloc_max_free_bytes_percentage", "100"));
- ASSERT_OK(cluster_->SetFlag(cluster_->tablet_server(1),
- "tcmalloc_max_free_bytes_percentage", "10"));
- ASSERT_OK(cluster_->SetFlag(cluster_->tablet_server(2),
- "tcmalloc_max_free_bytes_percentage", "100"));
-
// Start scan, then more memory will be allocated by tcmalloc.
{
TestWorkload workload(cluster_.get());
@@ -108,11 +108,11 @@ TEST_F(MemoryGcITest, TestPeriodicGc) {
NO_FATALS(
double ratio;
GetOverheadRatio(cluster_->tablet_server(0), &ratio);
- ASSERT_GE(ratio, 0.1);
+ ASSERT_GE(ratio, 0.1) << "tserver-0";
GetOverheadRatio(cluster_->tablet_server(1), &ratio);
- ASSERT_LE(ratio, 0.1);
+ ASSERT_LE(ratio, 0.1) << "tserver-1";
GetOverheadRatio(cluster_->tablet_server(2), &ratio);
- ASSERT_GE(ratio, 0.1);
+ ASSERT_GE(ratio, 0.1) << "tserver-2";
);
});
workload.StopAndJoin();