Browse Source

autotest: cast packet count to floast before determining rate

Could be causing rate to be zero on autotest server
master
Peter Barker 3 years ago committed by Peter Barker
parent
commit
af7208a65e
  1. 4
      Tools/autotest/common.py

4
Tools/autotest/common.py

@ -4218,8 +4218,8 @@ class AutoTest(ABC): @@ -4218,8 +4218,8 @@ class AutoTest(ABC):
for (t, want_rate) in message_rates.items():
if t not in counts:
raise NotAchievedException("Wanted %s but got none" % t)
self.progress("Got (%u)" % counts[t])
got_rate = counts[t] / delta_time_us * 1000000
self.progress("Got (%u) in (%uus)" % (counts[t], delta_time_us))
got_rate = float(counts[t]) / delta_time_us * 1000000
if abs(want_rate - got_rate) > 5:
raise NotAchievedException("Not getting %s data at wanted rate want=%f got=%f" %

Loading…
Cancel
Save