Skip to content

Commit c4665a6

Browse files
committed
test(perf): remove bidirectional throughput tests
These have only caused confusion, as they're output often makes no sense, and we generally just end up ignoring them (but have discussions about it every single time). Let's remove them. Signed-off-by: Patrick Roy <[email protected]>
1 parent 55d2769 commit c4665a6

File tree

3 files changed

+11
-41
lines changed

3 files changed

+11
-41
lines changed

tests/framework/utils_iperf.py

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ def run_test(self, first_free_cpu):
6565

6666
clients = []
6767
for client_idx in range(self._num_clients):
68-
client_mode = self.client_mode(client_idx)
69-
client_mode_flag = self.client_mode_to_iperf3_flag(client_mode)
7068
client_future = executor.submit(
71-
self.spawn_iperf3_client, client_idx, client_mode_flag
69+
self.spawn_iperf3_client,
70+
client_idx,
71+
self.client_mode_to_iperf3_flag,
7272
)
73-
clients.append((client_mode, client_future))
73+
clients.append((self._mode, client_future))
7474

7575
data = {"cpu_load_raw": cpu_load_future.result(), "g2h": [], "h2g": []}
7676

@@ -79,31 +79,12 @@ def run_test(self, first_free_cpu):
7979

8080
return data
8181

82-
def client_mode(self, client_idx):
83-
"""Converts client index into client mode"""
84-
match self._mode:
85-
case "g2h":
86-
client_mode = "g2h"
87-
case "h2g":
88-
client_mode = "h2g"
89-
case "bd":
90-
# in bidirectional mode we alternate
91-
# modes
92-
if client_idx % 2 == 0:
93-
client_mode = "g2h"
94-
else:
95-
client_mode = "h2g"
96-
return client_mode
97-
98-
@staticmethod
99-
def client_mode_to_iperf3_flag(client_mode):
82+
@property
83+
def client_mode_to_iperf3_flag(self):
10084
"""Converts client mode into iperf3 mode flag"""
101-
match client_mode:
102-
case "g2h":
103-
client_mode_flag = ""
104-
case "h2g":
105-
client_mode_flag = "-R"
106-
return client_mode_flag
85+
if self._mode == "h2g":
86+
return "-R"
87+
return ""
10788

10889
def spawn_iperf3_client(self, client_idx, client_mode_flag):
10990
"""

tests/integration_tests/performance/test_network.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def test_network_latency(network_microvm, metrics):
9191
@pytest.mark.timeout(120)
9292
@pytest.mark.parametrize("network_microvm", [1, 2], indirect=True)
9393
@pytest.mark.parametrize("payload_length", ["128K", "1024K"], ids=["p128K", "p1024K"])
94-
@pytest.mark.parametrize("mode", ["g2h", "h2g", "bd"])
94+
@pytest.mark.parametrize("mode", ["g2h", "h2g"])
9595
def test_network_tcp_throughput(
9696
network_microvm,
9797
payload_length,
@@ -109,12 +109,6 @@ def test_network_tcp_throughput(
109109
# Time (in seconds) for which iperf runs after warmup is done
110110
runtime_sec = 20
111111

112-
# We run bi-directional tests only on uVM with more than 2 vCPus
113-
# because we need to pin one iperf3/direction per vCPU, and since we
114-
# have two directions, we need at least two vCPUs.
115-
if mode == "bd" and network_microvm.vcpus_count < 2:
116-
pytest.skip("bidrectional test only done with at least 2 vcpus")
117-
118112
metrics.set_dimensions(
119113
{
120114
"performance_test": "test_network_tcp_throughput",

tests/integration_tests/performance/test_vsock.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def guest_command(self, port_offset):
7373
@pytest.mark.nonci
7474
@pytest.mark.parametrize("vcpus", [1, 2], ids=["1vcpu", "2vcpu"])
7575
@pytest.mark.parametrize("payload_length", ["64K", "1024K"], ids=["p64K", "p1024K"])
76-
@pytest.mark.parametrize("mode", ["g2h", "h2g", "bd"])
76+
@pytest.mark.parametrize("mode", ["g2h", "h2g"])
7777
def test_vsock_throughput(
7878
uvm_plain_acpi,
7979
vcpus,
@@ -85,11 +85,6 @@ def test_vsock_throughput(
8585
"""
8686
Test vsock throughput for multiple vm configurations.
8787
"""
88-
# We run bi-directional tests only on uVM with more than 2 vCPus
89-
# because we need to pin one iperf3/direction per vCPU, and since we
90-
# have two directions, we need at least two vCPUs.
91-
if mode == "bd" and vcpus < 2:
92-
pytest.skip("bidrectional test only done with at least 2 vcpus")
9388

9489
mem_size_mib = 1024
9590
vm = uvm_plain_acpi

0 commit comments

Comments
 (0)