Repository navigation
Backport metrics + DotNetty test stabilizations to v1.5 (#7798, #8273) - #8298
Merged
Aaronontheweb merged 2 commits intoJul 2, 2026
Conversation
…et#7798) - Fix MetricsCollectorSpec with platform-aware retry logic and progressive backoff - Fix MetricValuesSpec using IAsyncLifetime pattern to avoid constructor deadlocks - Add comprehensive timeout handling and exception recovery for CI environments - Optimize test data generation to use single sample instead of 202 real samples - Increase timeouts from 30s to 60s for DefaultCollector initialization timing (cherry picked from commit 3abeec2)
…akkadotnet#8273) DotNettyTcpTransport_should_cleanly_terminate_endpoints_upon_failed_outbound_connection bound to port 0 (OS-assigned ephemeral) and targeted boundPort + 100 to force a connect failure. On Windows the dynamic port range tops out at 65535, so when the OS assigned a port in [65436, 65535], boundPort + 100 exceeded IPEndPoint.MaxPort and the IPEndPoint ctor in AddressToSocketAddress threw ArgumentOutOfRangeException before the connect, escaping the InvalidAssociationException assertion. Linux's default ephemeral range caps below that band, so it only flaked on Windows. Offset the dead port down when near the top of the range so it always stays within 0-65535 while still pointing at a port where nothing is listening. (cherry picked from commit b9f263c)
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.
Backport: test-stability fixes to
v1.5(#7798, #8273)These are test-only flaky-test backports. Both fixes already landed on
devbut were never onv1.5, so the flaky specs continue to fail intermittently onv1.5PR CI (e.g. seen on #8294). This PR brings them over as two individual cherry-picks (with-xprovenance), in chronological order.What each PR stabilizes
3abeec261(2025-09-04)Akka.Cluster.Metrics.Tests/Base/AkkaSpecWithCollector.cs,MetricSpec.cs,MetricsCollectorSpec.csMetricValuesSpec.NodeMetrics_MetricValues_should_extract_expected_metrics_for_load_balancingand..._expected_MetricValue_types_for_load_balancing— replaces the live-collectorCreateTestData(202, 10.Seconds(), ...)sampling (which required ~10s of real system metrics and could deadlock/flake in CI) with deterministicCreateTestMetrics()/CreateTestMetricsVariation(), and makesMetricValuesSpecindependent of theAkkaSpecWithCollectorbase. Also adds retry/backoff + longer timeouts to the remaining live-collector paths (CreateTestDataAsync,MetricsCollectorSpec).b9f263c0f(2026-06-16)Akka.Remote.Tests/Transport/DotNettyTransportShutdownSpec.csDotNettyTcpTransport_should_cleanly_terminate_endpoints_upon_failed_outbound_connection(Windows-only flake). Clamps the "dead port" target soboundPort + 100can't exceedIPEndPoint.MaxPort(65535) when the OS assigns a high ephemeral port on Windows.Hand-porting
None required. Both commits cherry-picked cleanly onto
v1.5— the touched regions onv1.5were byte-for-byte identical to thedevpre-fix state. (The metrics test project builds againstAkka.TestKit.Xunitonv1.5; the ported code compiles against it without changes, so no xUnit-namespace adaptation was needed.)Local validation (net10.0, Linux)
MetricValuesSpec+MetricsCollectorSpec: Passed — 5/5 (~7s).DotNettyTcpTransport_should_cleanly_terminate_endpoints_upon_failed_outbound_connection: Passed — 1/1 (~0.4s; it was a Windows-only flake, so it passes on Linux and now also can't overflow).Scope
This PR is separate from #8294 (the #8031 consistent-hashing fix) and #8296 (an earlier flaky-test backport) — it does not touch those branches or their commits.