Skip to content

lwip: Added delay to dtls handshake test to compensate for local network #3781

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

Merged
merged 1 commit into from
Feb 17, 2017

Conversation

geky
Copy link
Contributor

@geky geky commented Feb 15, 2017

The speed of packets on the local network exceeds even the speed of the ethernet hardware on some of the less powerful devices. Adding a small delay which can be expected from a real DTLS handshake prevents this condition from occuring.

Let me know if there is still problems with this test as this delay may need to be refined.

cc @bridadan, @MarceloSalazar
should resolve #3549

Copy link
Contributor

@bridadan bridadan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I increased the delay on my machine it worked ok. Any idea if there's a standard "dely" for this type of thing? Or should the host test resend stuff?

@@ -42,6 +43,9 @@ def handle(self):
data = ''.join(map(chr, data))
sock.sendto(data, self.client_address)

# Sleep a tiny bit to compensate for local network
time.sleep(0.001)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to increase this to 0.01 on my machine for this to work

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked with @bridadan offline, looks like I had forgotten the MBED_STACK_STATS_ENABLED and MBED_HEAP_STATS_ENABLED, which cause increased delay on the device side.

The speed of packets on the local network exceeds even the speed of
the ethernet hardware on some of the less powerful devices. Adding
a small delay which can be expected from a real DTLS handshake prevents
this condition from occuring.
@geky
Copy link
Contributor Author

geky commented Feb 15, 2017

Fixed the delay issue.

As I understand there isn't a set delay in the DTLS specification, so it's basically up to the DTLS implementation to be nice to the slow devices.

@bridadan
Copy link
Contributor

/morph test-nightly

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1604

All builds and test passed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ARCH_PRO] features-feature_lwip-tests-mbedmicro-net-udp_dtls_handshake test failing
4 participants