From ed5e3c185a135023d2c35706b6acd450d2cc7f10 Mon Sep 17 00:00:00 2001 From: Jimi Chen Date: Thu, 24 Jul 2025 13:37:37 +0000 Subject: [PATCH] Send multiple packets for stability The test was observed to be flaky when sending a single packet. Sending three packets increases the likelihood of the test's assertion passing reliably, addressing potential timing issues or packet loss. Flag: EXEMPT test only Bug: 419427388 Test: atest CtsConnectivityMultiDevicesTestCases:ApfV6Test --iteration 10 Change-Id: I42426d49a81871e6c8e275b1bd8cb0964290ce17 --- staticlibs/testutils/host/python/apf_test_base.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/staticlibs/testutils/host/python/apf_test_base.py b/staticlibs/testutils/host/python/apf_test_base.py index 8c341ac1cc..43ebaab81d 100644 --- a/staticlibs/testutils/host/python/apf_test_base.py +++ b/staticlibs/testutils/host/python/apf_test_base.py @@ -140,9 +140,11 @@ class ApfTestBase(multi_devices_test_base.MultiDevicesTestBase): counter_name, ) - apf_utils.send_raw_packet_downstream( - self.serverDevice, self.server_iface_name, send_packet - ) + # send 3 packets to prevent flaky test result + for _ in range(3): + apf_utils.send_raw_packet_downstream( + self.serverDevice, self.server_iface_name, send_packet + ) assert_utils.expect_with_retry( lambda: apf_utils.get_matched_packet_counts(