You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many of the scripts use ceil() or int() to find some approximate values. This sometimes results in unnecessary failures. One example is below:
background_loss = 0
for row in rows:
if 'Test Flow' in row.name:
pytest_assert(int(row.loss) == 0, "FAIL: {} must have 0% loss".format(row.name))
elif 'Background Flow' in row.name:
background_loss += float(row.loss)
> pytest_assert(int(background_loss/4) == 10, "Each Background Flow must have an avg of 10% loss ")
E Failed: Each Background Flow must have an avg of 10% loss
background_loss = 39.998999999999995
row = <snappi.snappi.FlowMetric object at 0x7f90adb90d40>
rows = <snappi.snappi.FlowMetricIter object at 0x7f90adce1340>
rx_port = {'api_server_ip': '172.27.147.46', 'asic_type': 'cisco-8000', 'asic_value': 'asic0', 'card_id': '1', ...}
tx_port = [{'api_server_ip': '172.27.147.46', 'asic_type': 'cisco-8000', 'asic_value': 'asic0', 'card_id': '1', ...}, {'api_server_ip': '172.27.147.46', 'asic_type': 'cisco-8000', 'asic_value': 'asic0', 'card_id': '1', ...}]
snappi_tests/multidut/pfc/files/m2o_fluctuating_lossless_helper.py:418: Failed
As we can see, the background_loss value is nearly 40, but the int() call changes it to 9 instead of 10, and above check fails. We should use round() function as below:
Issue Description
Many of the scripts use ceil() or int() to find some approximate values. This sometimes results in unnecessary failures. One example is below:
As we can see, the background_loss value is nearly 40, but the int() call changes it to 9 instead of 10, and above check fails. We should use round() function as below:
@selldinesh , @kamalsahu0001 , @sdszhang , @auspham : FYI
Results you see
Test fails on approximate calculations.
Results you expected to see
The test should pass.
Is it platform specific
generic
Relevant log output
The text was updated successfully, but these errors were encountered: