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

[Test] Use Unix sockets for reliability #571

Merged
merged 4 commits into from
Feb 28, 2025
Merged

[Test] Use Unix sockets for reliability #571

merged 4 commits into from
Feb 28, 2025

Conversation

mmtftr
Copy link

@mmtftr mmtftr commented Feb 26, 2025

Description

Some tests are flaky due to the many ports we allocate for each test with actors. TCP has an overhead and is quite a lot slower when bound by bandwidth. More importantly, due to the increasingly parallelized tests, we have flaky tests due to port collisions when allocating ports.

This PR migrates the random TCP port allocation to random Unix socket allocation by generalizing connection primitives and refactoring test utils

Linked Issues

Testing

The tests must execute without flakiness

Docs

Docs have been updated for test utils.

…erver creation

This commit introduces several improvements to server creation:
- Added a generic `create_grpc_server` function that supports both TCP and Unix socket servers
- Created a `ServerAddr` enum to handle different address types
- Implemented Unix socket server creation methods for verifier, operator, aggregator, and watchtower
- Updated test utilities to use Unix sockets for inter-service communication
- Added shutdown channel support for graceful server termination

The changes provide more flexibility in server configuration and improve testing capabilities by allowing Unix socket communication.
…l support

This commit improves the RPC client connection mechanism:
- Updated `get_clients` function to support both TCP and Unix socket connections
- Modified client connection methods to use Hyper and Tokio for more flexible networking
- Refactored client initialization to use channel-based connections
- Updated test utilities to use the new generic client connection method
- Added support for Unix socket paths in endpoint configuration
@mmtftr mmtftr changed the base branch from main to dev February 26, 2025 15:22
@mmtftr
Copy link
Author

mmtftr commented Feb 26, 2025

It seems that unix sockets are slightly slower in our case. Not sure why, but this PR is still a must-have since it fixes flaky tests.

@mmtftr mmtftr changed the title [Test] Use Unix sockets for speed and reliability [Test] Use Unix sockets for ~speed and~ reliability Feb 26, 2025
@mmtftr mmtftr changed the title [Test] Use Unix sockets for ~speed and~ reliability [Test] Use Unix sockets for reliability Feb 26, 2025
@mmtftr mmtftr requested review from ceyhunsen and ekrembal and removed request for ceyhunsen February 27, 2025 15:05
Windows will not be able to run tests
@mmtftr mmtftr merged commit cbcb085 into dev Feb 28, 2025
9 checks passed
@mmtftr mmtftr deleted the efe/unix-sockets branch February 28, 2025 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Test] Use Unix domain sockets for speed and reliability
2 participants