-
Notifications
You must be signed in to change notification settings - Fork 3k
Tolerate packet loss up to 30% in udp echo tests #7209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@SeppoTakalo @juhaylinen please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calculations are not accurate enough for small packet numbers.
Use floating point, not integers.
Or use fixed points calculations.
For example, when packets_recv
is 80 and packets_sent
is 100:
1 - (packets_recv / packets_sent)
Becomes
1 - (80 / 100) which is
1 - (0)
} | ||
// Packet loss up to 30% tolerated | ||
if (packets_sent > 0) { | ||
printf("Packets sent: %d, packets received %d, loss ratio %.2lf\r\n", packets_sent, packets_recv, 1 - (packets_recv / packets_sent)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 - (packets_recv / packets_sent)
is integer calculation.
Convert to float for proper calculation.
} | ||
free(stack_mem); | ||
// Packet loss up to 30% tolerated | ||
if (packets_sent > 0) { | ||
printf("Packets sent: %d, packets received %d, loss ratio %.2lf\r\n", packets_sent, packets_recv, 1 - (packets_recv / packets_sent)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, convert to float before calculation.
e93d5e0
to
3f35288
Compare
Changes made according to review |
3f35288
to
6bdefd3
Compare
Is there some issues in the CI servers, some builds are failing after git checkout? |
@cmonr is it possible to trigger the failed Jenkins job again, it seems to be working again. |
@jarlamsa Yup! Will be restarting the job momentarily. Thw way the job failed is new, so I'm capturing the logs before restarting it. |
@SeppoTakalo Mind re-reviewing? |
/morph build |
Build : SUCCESSBuild number : 2353 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 1977 |
Test : SUCCESSBuild number : 2139 |
Description
UDP echo tests to tolerate packet loss up to 30%
Packet loss percentage is also printed in the end of each test.
Pull request type