Skip to content
Permalink
Browse files
8240222: [TESTBUG] gtest/jfr/test_networkUtilization.cpp failed when …
…the number of tests is greater than or equal to 2

Reviewed-by: egahlin, mgronlun
  • Loading branch information
Jia Huang committed Mar 20, 2020
1 parent cc83c45 commit 95d2830361091275256868a6bb2a310ed5683e91
Showing with 9 additions and 7 deletions.
  1. +9 −7 test/hotspot/gtest/jfr/test_networkUtilization.cpp
@@ -242,9 +242,11 @@ class JfrTestNetworkUtilization : public ::testing::Test {
}
};

static traceid id = 0;

TEST_VM_F(JfrTestNetworkUtilization, RequestFunctionBasic) {

MockNetworkInterface& eth0 = MockJfrOSInterface::add_interface("eth0", 1);
MockNetworkInterface& eth0 = MockJfrOSInterface::add_interface("eth0", ++id);
JfrNetworkUtilization::send_events();
ASSERT_EQ(0u, MockEventNetworkUtilization::committed.size());

@@ -261,9 +263,9 @@ TEST_VM_F(JfrTestNetworkUtilization, RequestFunctionBasic) {

TEST_VM_F(JfrTestNetworkUtilization, RequestFunctionMultiple) {

MockNetworkInterface& eth0 = MockJfrOSInterface::add_interface("eth0", 2);
MockNetworkInterface& eth1 = MockJfrOSInterface::add_interface("eth1", 3);
MockNetworkInterface& ppp0 = MockJfrOSInterface::add_interface("ppp0", 4);
MockNetworkInterface& eth0 = MockJfrOSInterface::add_interface("eth0", ++id);
MockNetworkInterface& eth1 = MockJfrOSInterface::add_interface("eth1", ++id);
MockNetworkInterface& ppp0 = MockJfrOSInterface::add_interface("ppp0", ++id);
JfrNetworkUtilization::send_events();
ASSERT_EQ(0u, MockEventNetworkUtilization::committed.size());

@@ -292,8 +294,8 @@ TEST_VM_F(JfrTestNetworkUtilization, RequestFunctionMultiple) {
}

TEST_VM_F(JfrTestNetworkUtilization, InterfaceRemoved) {
MockNetworkInterface& eth0 = MockJfrOSInterface::add_interface("eth0", 5);
MockNetworkInterface& eth1 = MockJfrOSInterface::add_interface("eth1", 6);
MockNetworkInterface& eth0 = MockJfrOSInterface::add_interface("eth0", ++id);
MockNetworkInterface& eth1 = MockJfrOSInterface::add_interface("eth1", ++id);
JfrNetworkUtilization::send_events();
ASSERT_EQ(0u, MockEventNetworkUtilization::committed.size());

@@ -329,7 +331,7 @@ TEST_VM_F(JfrTestNetworkUtilization, InterfaceRemoved) {
}

TEST_VM_F(JfrTestNetworkUtilization, InterfaceReset) {
MockNetworkInterface& eth0 = MockJfrOSInterface::add_interface("eth0", 7);
MockNetworkInterface& eth0 = MockJfrOSInterface::add_interface("eth0", ++id);
JfrNetworkUtilization::send_events();
ASSERT_EQ(0u, MockEventNetworkUtilization::committed.size());

0 comments on commit 95d2830

Please sign in to comment.