fix(testing): prevent DI container disposal during test execution#234
Merged
Conversation
…ects - Removed `System.Net.Http` and `System.Text.RegularExpressions` package references from test projects. - Streamlined dependencies to improve project maintainability.
…ring test execution - Added delays in `DiLambdaTests` to prevent the DI container from being disposed prematurely. - Updated `CancellationToken` usage to use `TestContext.Current.CancellationToken`. - Improved test stability in scenarios where initialization fails or exits early.
… resolver rules - Updated `.editorconfig` to apply formatting rules to all `HostFactoryResolver.cs` files. - Adjusted Rider settings to ensure consistent reformatting across multiple languages. - Enabled C# documentation comments formatting in Rider settings.
- Updated formatting in `LambdaServerOptions` for consistent inline documentation. - Changed default `FunctionTimeout` from 15 minutes to 3 seconds with relevant documentation link. - Simplified exception handling logic in `DeferredHostBuilder`.
…ng models and extensions - Replaced multi-line XML documentation with consistent single-line descriptions for readability. - Simplified and formatted comments in `InvocationResponse`, `ErrorResponse`, `InitResponse`, and related models. - Standardized usage of `<see cref>` inline references for improved clarity and consistency in codebase. - Adjusted extension method comments in `LambdaTestServerExtensions` to align with updated formatting style.
- Changed `FunctionTimeout` default in `LambdaServerOptions` from 3 minutes to 3 seconds. - Updated inline XML documentation link for better clarification.
- Updated the version in `Directory.Build.props` to 2.0.0-beta.5.
j-d-ha
enabled auto-merge (squash)
December 14, 2025 17:33
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #234 +/- ##
==========================================
- Coverage 89.61% 87.91% -1.70%
==========================================
Files 104 122 +18
Lines 2128 2864 +736
Branches 253 334 +81
==========================================
+ Hits 1907 2518 +611
- Misses 129 216 +87
- Partials 92 130 +38
... and 3 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
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.



🚀 Pull Request
📋 Summary
This PR fixes an issue where the DI container was being disposed before test invocations could complete, causing test failures. The fix adds proper delay handling in
DiLambdaTests.csto ensure the container remains available throughout the test execution lifecycle.Additionally includes:
✅ Checklist
🧪 Related Issues or PRs
Fixes the DI container disposal timing issue in test execution.
💬 Notes for Reviewers
The primary fix is in
DiLambdaTests.cswhere delay handling was added to prevent the DI container from being disposed prematurely during test execution. The other changes are maintenance updates including documentation formatting and version bumping.