Make reverse connect lifecycle fully asynchronous#4059
Conversation
…verse-connect-lifecycle
…verse-connect-lifecycle
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Makes reverse-connect startup/shutdown fully async across core + DI + samples, and expands tests/docs to cover cancellation, host integration, and restart/rollback scenarios.
Changes:
- Update test fixtures and integration tests to use
DisposeAsync/ async teardown patterns. - Add async DI lifecycle support (hosted service + async config provider model) and document migration path.
- Extend
ReverseConnectHostwith serialized async open/close/dispose behavior and add extensive concurrency/teardown tests.
Reviewed changes
Copilot reviewed 22 out of 24 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Opc.Ua.Sessions.Tests/WssReverseConnectIntegrationTests.cs | Switches fixture teardown to async disposal. |
| tests/Opc.Ua.Sessions.Tests/ReverseConnectTest.cs | Converts one-time teardown to async disposal. |
| tests/Opc.Ua.Sessions.Tests/KestrelTcpReverseConnectIntegrationTests.cs | Switches fixture teardown to async disposal. |
| tests/Opc.Ua.Core.Tests/Stack/Client/ReverseConnectHostTests.cs | Adds disposal + concurrency/serialization coverage for ReverseConnectHost. |
| tests/Opc.Ua.Client.Tests/ClientBuilder/ReverseConnectManagerTests.cs | Disables obsolete warnings to cover sync compatibility wrappers. |
| tests/Opc.Ua.Client.Tests/ClientBuilder/ClientReverseConnectOptionsTests.cs | Adds DI/host/lazy/eager startup + provider + restart overlay tests. |
| tests/Opc.Ua.Client.TestFramework/TestFixture.cs | Updates teardown to DisposeAsync. |
| tests/Opc.Ua.Client.TestFramework/ClientTestFramework.cs | Updates teardown to DisposeAsync. |
| tests/Opc.Ua.Client.TestFramework/ClientFixture.cs | Introduces IAsyncDisposable and async teardown path for fixtures. |
| tests/Opc.Ua.Aot.Tests/HostingAotTests.cs | Extends AOT coverage to resolve reverse-connect services. |
| src/Opc.Ua.Core/Stack/Client/ReverseConnectHost.cs | Adds IAsyncDisposable and serializes lifecycle operations with deterministic teardown. |
| src/Opc.Ua.Client/Opc.Ua.Client.csproj | Adds hosting abstractions reference for hosted-service integration. |
| src/Opc.Ua.Client/NugetREADME.md | Documents async reverse-connect lifecycle + DI behavior. |
| src/Opc.Ua.Client/IReverseConnectConfigurationProvider.cs | Adds injectable async configuration provider API + default pass-through impl. |
| src/Opc.Ua.Client/Fluent/ReverseConnectManagerHostedService.cs | Adds hosted service to eagerly start/stop manager under Generic Host. |
| src/Opc.Ua.Client/Fluent/OpcUaClientOptions.cs | Updates options docs to reflect eager/lazy async startup. |
| src/Opc.Ua.Client/Fluent/OpcUaClientBuilderExtensions.cs | Registers provider + hosted service; updates manager activator for async startup model. |
| src/Opc.Ua.Client/Fluent/ClientReverseConnectOptions.cs | Updates docs to describe hosted + lazy startup behavior. |
| samples/ConsoleReferenceClient/Program.cs | Migrates sample to StartServiceAsync / DisposeAsync. |
| docs/migrate/2.0.x/transport-listener-async.md | Documents new async reverse-connect lifecycle + migration steps. |
| docs/migrate/2.0.x/README.md | Updates migration index entry to include reverse-connect changes. |
| docs/ReverseConnect.md | Updates canonical reverse-connect docs for async + DI/provider lifecycle. |
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (54.08%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.
Additional details and impacted files@@ Coverage Diff @@
## master #4059 +/- ##
===========================================
- Coverage 73.86% 34.15% -39.72%
===========================================
Files 1345 894 -451
Lines 180038 130233 -49805
Branches 31678 23757 -7921
===========================================
- Hits 132993 44483 -88510
- Misses 36290 79898 +43608
+ Partials 10755 5852 -4903
🚀 New features to boost your workflow:
|
Summary
ReverseConnectManagerReverseConnectHostlifecycle and extend raw TCP, Kestrel TCP, WSS, hosting, concurrency, rollback, and NativeAOT coverageValidation
Opc.Ua.ClientRelease build across all supported target frameworksCloses #4013.
Related: #3985, #4009.