diff --git a/tests/saitests/py3/sai_qos_tests.py b/tests/saitests/py3/sai_qos_tests.py index c73d0b02f94..1e143646bd5 100755 --- a/tests/saitests/py3/sai_qos_tests.py +++ b/tests/saitests/py3/sai_qos_tests.py @@ -3448,22 +3448,23 @@ def get_pfc_tx_cnt(src_port_id, pg_cntr_idx): # Verify no ingress/egress drops for all ports pg_drop_counters = {port_id: sai_thrift_read_pg_drop_counters( self.src_client, port_list['src'][port_id]) for port_id in uniq_srcs} - for src_port_id in uniq_srcs: - for pg in range(len(pg_drop_counters[src_port_id])): - drops = pg_drop_counters[src_port_id][pg] - pg_drop_counters_bases[src_port_id][pg] + for uniq_src_port_id in uniq_srcs: + for pg in range(len(pg_drop_counters[uniq_src_port_id])): + drops = pg_drop_counters[uniq_src_port_id][pg] - pg_drop_counters_bases[uniq_src_port_id][pg] if pg in [3, 4]: - assert drops == 0, "Detected %d lossless drops on PG %d src port %d" % (drops, pg, src_port_id) + assert drops == 0, \ + "Detected %d lossless drops on PG %d src port %d" % (drops, pg, uniq_src_port_id) elif drops > 0: # When memory is full, any new lossy background traffic is dropped. print("Observed lossy drops %d on PG %d src port %d, expected." % - (drops, pg, src_port_id), file=sys.stderr) + (drops, pg, uniq_src_port_id), file=sys.stderr) xmit_counters_list = {port_id: sai_thrift_read_port_counters( self.dst_client, self.asic_type, port_list['dst'][port_id])[0] for port_id in uniq_dsts} - for dst_port_id in uniq_dsts: + for uniq_dst_port_id in uniq_dsts: for cntr in self.egress_counters: - drops = xmit_counters_list[dst_port_id][cntr] - \ - xmit_counters_bases[dst_port_id][cntr] - assert drops == 0, "Detected %d egress drops on dst port id %d" % (drops, dst_port_id) + drops = xmit_counters_list[uniq_dst_port_id][cntr] - \ + xmit_counters_bases[uniq_dst_port_id][cntr] + assert drops == 0, "Detected %d egress drops on dst port id %d" % (drops, uniq_dst_port_id) first_port_id = self.dst_port_ids[0] last_port_id = self.dst_port_ids[-1]