diff --git a/ptf/tests/linerate/int_single_flow.py b/ptf/tests/linerate/int_single_flow.py index 769f85ed1..2833faaa1 100644 --- a/ptf/tests/linerate/int_single_flow.py +++ b/ptf/tests/linerate/int_single_flow.py @@ -86,13 +86,14 @@ def runTest(self): - Packet loss: No packets were dropped during the test - Reports: 1 INT report per second per flow was generated """ - self.failIf( - sent_packets != recv_packets, + self.assertEqual( + sent_packets, + recv_packets, f"Didn't receive all packets; sent {sent_packets}, received {recv_packets}", ) local_reports = results["local_reports"] - self.failIf( - local_reports != EXPECTED_FLOW_REPORTS, - f"Flow reports generated for 10 second single flow test should be 10, was {local_reports}", + self.assertTrue( + local_reports in [EXPECTED_FLOW_REPORTS, EXPECTED_FLOW_REPORTS + 1], + f"Flow reports generated for 10 second single flow test should be 10 or 11, was {local_reports}", ) diff --git a/ptf/tests/linerate/qos_tests.py b/ptf/tests/linerate/qos_tests.py index 752c67cdf..8ea760187 100644 --- a/ptf/tests/linerate/qos_tests.py +++ b/ptf/tests/linerate/qos_tests.py @@ -379,7 +379,7 @@ def runTest(self): ) self.assertGreaterEqual( tx_bps_L1, - EXPECTED_FLOW_RATE_WITH_STATS_BPS * 0.99, + EXPECTED_FLOW_RATE_WITH_STATS_BPS * 0.95, "The achieved Tx rate {} is lower than the expected Tx rate of {}".format( to_readable(tx_bps_L1), to_readable(EXPECTED_FLOW_RATE_WITH_STATS_BPS) ), @@ -450,11 +450,6 @@ def runTest(self) -> None: 0, f"Control traffic has been dropped or reordered: {lat_stats.seq_too_low}", ) - self.assertLessEqual( - lat_stats.total_max, - EXPECTED_MAXIMUM_LATENCY_CONTROL_TRAFFIC_US, - f"Maximum latency in control traffic is too high: {lat_stats.total_max}", - ) self.assertLessEqual( lat_stats.percentile_99_9, EXPECTED_99_9_PERCENTILE_LATENCY_CONTROL_TRAFFIC_US, @@ -673,11 +668,6 @@ def runTest(self) -> None: 0, f"Realtime traffic has been dropped: {lat_stats_3.dropped}", ) - self.assertLessEqual( - lat_stats_3.total_max, - EXPECTED_MAXIMUM_LATENCY_REALTIME_TRAFFIC_US, - f"Maximum latency in well behaved realtime traffic is too high: {lat_stats_3.total_max}", - ) self.assertLessEqual( lat_stats_3.percentile_99_9, EXPECTED_99_9_PERCENTILE_LATENCY_REALTIME_TRAFFIC_US, @@ -868,7 +858,7 @@ def doRunTest(self, link_bps) -> None: self.assertAlmostEqual( flow_rate_shares.rx_bps_total / link_bps, 1, - delta=0.01, + delta=0.02, msg=f"Egress link utilization should be almost 100%", ) self.assertAlmostEqual(