You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ta...@apache.org on 2019/04/16 20:24:52 UTC

[impala] 01/05: IMPALA-8413: Don't assume non-zero network counters in tests

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

tarmstrong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit a223353c6d2daa6184566914c08aeab5eb3d3a08
Author: Lars Volker <lv...@cloudera.com>
AuthorDate: Mon Apr 15 11:27:27 2019 -0700

    IMPALA-8413: Don't assume non-zero network counters in tests
    
    In virtualized test environments (e.g. docker) we have seen cases where
    some of the network counters are still zero when the
    system-state-info-test runs. This change adjusts the test to allow
    counters to be zero, since other tests make sure that non-zero values
    are parsed correctly.
    
    Change-Id: I39e18510b1c20749e218748eaaffb74abeae4ebe
    Reviewed-on: http://gerrit.cloudera.org:8080/13017
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 be/src/util/system-state-info-test.cc | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/be/src/util/system-state-info-test.cc b/be/src/util/system-state-info-test.cc
index a02a140..50b0c97 100644
--- a/be/src/util/system-state-info-test.cc
+++ b/be/src/util/system-state-info-test.cc
@@ -52,10 +52,12 @@ TEST_F(SystemStateInfoTest, ReadProcStat) {
 TEST_F(SystemStateInfoTest, ReadProcNetDev) {
   info.ReadCurrentProcNetDev();
   const SystemStateInfo::NetworkValues& state = info.network_values_[info.net_val_idx_];
-  EXPECT_GT(state[SystemStateInfo::NET_RX_BYTES], 0);
-  EXPECT_GT(state[SystemStateInfo::NET_RX_PACKETS], 0);
-  EXPECT_GT(state[SystemStateInfo::NET_TX_BYTES], 0);
-  EXPECT_GT(state[SystemStateInfo::NET_TX_PACKETS], 0);
+  // IMPALA-8413: Don't assume that counters are non-zero as that is sometimes not the
+  // case, e.g. in virtualized environments.
+  EXPECT_GE(state[SystemStateInfo::NET_RX_BYTES], 0);
+  EXPECT_GE(state[SystemStateInfo::NET_RX_PACKETS], 0);
+  EXPECT_GE(state[SystemStateInfo::NET_TX_BYTES], 0);
+  EXPECT_GE(state[SystemStateInfo::NET_TX_PACKETS], 0);
 }
 
 // Smoke test to make sure that we read non-zero values from /proc/diskstats.