Repository navigation
fix(aspnetcore): initialize web application factories through services - #6956
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe initialization semaphore now guards access to ChangesHost initialization
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to Host initialization remains serialized, and the change enables the inspected Kestrel factory path without changing TestServer behavior. No material merge risk remains. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change preserves per-test factory ownership, startup throttling, and disposal delegation. No security-control bypass was demonstrated, but this partial fix does not establish complete Kestrel compatibility or cleanup across derived factories. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit checks the host with care, Comment |
ReviewSmall, focused change: Observations (non-blocking):
No issues found. LGTM. |
|
Description
WebApplicationTest.InitializeFactoryAsynceagerly initializes isolated applications throughWebApplicationFactory.Server, which is specific toTestServerand is unsupported for Kestrel factories. Initialize throughServicesinstead: this starts the application with either transport while preserving the existing semaphore, cancellation, and disposal behavior.Related Issue
Related to #6955. This is a partial compatibility fix and should not close that issue: the separate
WithWebHostBuilderKestrel configuration/client delegation bug is tracked in dotnet/aspnetcore#69655.Type of Change
Checklist
Testing
dotnet test --project tests/TUnit.AspNetCore.Tests/TUnit.AspNetCore.Tests.csprojAll 324 tests passed: 108 on net8.0, 108 on net9.0, and 108 on net10.0. Existing regression coverage is reused; no new tests were added for this property substitution.
Also verified a standalone net10.0 reproduction using Microsoft.AspNetCore.Mvc.Testing 10.0.12: accessing
Servicesstarts a directly configured Kestrel factory and its client successfully requests/ping. The upstream report includes the reproduction and the remaining derived-factory failures.Summary by CodeRabbit