Skip to content
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

[Net] Fix TCP/UDP server network tests #100107

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

Faless
Copy link
Collaborator

@Faless Faless commented Dec 6, 2024

Some tests have been removed since there's no way to guarantee they will pass.

Other tests have been refactored to ensure proper waiting, and taking into account potential out-of-order delivery (which is unlikely in test scenarios but expecting a specific order on a UDP socket is wrong and OSes makes no promises of ordered delivery on localhost).

@Faless Faless requested a review from a team as a code owner December 6, 2024 16:27
@akien-mga akien-mga added this to the 4.4 milestone Dec 6, 2024
Some tests have been removed since there's no way to guarantee they will
pass.

Other tests have been refactored to ensure proper waiting, and taking
into account potential out-of-order delivery (which is unlikely in test
scenarios but expecting a specific order on a UDP socket is wrong and
OSes makes no promises of ordered delivery on localhost).
namespace TestTCPServer {

const int PORT = 12345;
const IPAddress LOCALHOST("127.0.0.1");
const uint32_t SLEEP_DURATION = 1000;
const uint64_t MAX_WAIT_USEC = 100000;
const uint64_t MAX_WAIT_USEC = 2000000;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I raised this so we could also test the timeout functionality when testing the connection to a server that is not listening.

This should not affect the timing of other tests unless they fail, but we can maybe make this a parameter of wait_for_condition and only have the higher value in that specific test.

@pafuent
Copy link
Contributor

pafuent commented Dec 6, 2024

Thanks for taking care of this!
Also, I learned some new things from reading your code!

@Repiteo Repiteo merged commit f0f5319 into godotengine:master Feb 6, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Feb 6, 2025

Thanks!

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.

4 participants