test: centralize test helpers and remove fixed ports from Zenoh test suites#2573
Merged
OlivierHecart merged 14 commits intoApr 24, 2026
Merged
Conversation
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Move get_locators_from_session and get_locators_from_session_sync out of TestSessions into free functions since they don't use self. Also add crate-level docs, doc comments on all public items, make TIMEOUT public, remove stale #![allow(dead_code)], and drop unused zenoh-protocol dep. Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Replace TestSessions::get_locators_from_session(_sync) calls with the newly extracted free functions across adminspace, low_pass, open_time, session, and unicity test files. Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Rewrite commons/zenoh-test/README.md to reflect the current API (free functions + TestSessions) and delete the now-stale zenoh/tests/README.md whose content has been superseded. Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Refactored tests in zenoh-ext/tests/advanced.rs to use TestSessions for peer-to-peer cases and get_free_port() for reconnect cases. This prevents port collisions during parallel test execution.
Refactored tests in zenoh-ext/tests/liveliness.rs to use TestSessions custom configurations, preventing port collisions during parallel test execution. Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Applied rustfmt to various test files across zenoh and zenoh-ext to ensure consistent formatting and resolve import ordering warnings. Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
evshary
force-pushed
the
update_zenoh_ext_test
branch
from
April 18, 2026 00:33
36907f3 to
5a4724c
Compare
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
evshary
force-pushed
the
update_zenoh_ext_test
branch
from
April 18, 2026 00:50
5a4724c to
5426f8c
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2573 +/- ##
==========================================
+ Coverage 74.70% 74.75% +0.04%
==========================================
Files 399 400 +1
Lines 59535 59716 +181
==========================================
+ Hits 44478 44640 +162
- Misses 15057 15076 +19 ☔ View full report in Codecov by Sentry. |
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
evshary
force-pushed
the
update_zenoh_ext_test
branch
from
April 24, 2026 03:35
48f227e to
85f3b63
Compare
OlivierHecart
approved these changes
Apr 24, 2026
4 tasks
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces a shared
zenoh-testcrate and uses it to clean up test setup acrosszenoh,zenoh-ext, andio/zenoh-transport. The main goal is to remove hardcoded ports and reduce port-collision failures during parallel test execution.What does this PR do?
commons/zenoh-testzenoh/tests/common/mod.rscommons/zenoh-test/README.mdget_free_port()->get_free_tcp_port()get_free_udp_port()for UDP-based transport testszenohtests to avoid fixed portszenoh/src/tests/session.rszenoh/src/tests/link_weights.rszenoh/src/tests/interceptor_cache.rszenoh-exttests to use dynamic port allocation and the new helper crateadvanced.rsandliveliness.rsio/zenoh-transporttests to replace fixed TCP/UDP/WS/TLS/QUIC ports with dynamic allocationendpoints.rsio/zenoh-transport/testsRelated Issues
#2526
🏷️ Label-Based Checklist
Based on the labels applied to this PR, please complete these additional requirements:
Labels:
enhancement✨ Enhancement Requirements
Since this PR enhances existing functionality:
Remember: Enhancements should not introduce new APIs or breaking changes.
Instructions:
- [ ]to- [x])This checklist updates automatically when labels change, but preserves your checked boxes.