Skip failing tests on Linux Cosmos emulator - #38808
Open
AndriySvyryd wants to merge 1 commit into
Open
Conversation
Cleanup service providers proactively in tests
There was a problem hiding this comment.
Pull request overview
This PR aims to reduce test flakiness across environments by (1) skipping known-problematic Cosmos emulator scenarios on Linux and (2) improving test fixture cleanup by disposing the fixture’s service provider. It also adjusts a relational UDF test to run under non-RELEASE builds.
Changes:
- Dispose
SharedStoreFixtureBase’sServiceProviderduring fixture teardown. - Skip oversized-request Cosmos tests on the Linux Cosmos emulator via
ConditionalFact. - Update a relational UDF test to include non-RELEASE behavior (but the current expectation likely breaks Debug builds).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/EFCore.Specification.Tests/SharedStoreFixtureBase.cs | Adds service provider disposal during async fixture teardown. |
| test/EFCore.Relational.Specification.Tests/Query/UdfDbFunctionTestBase.cs | Changes conditional compilation for a nullable-return UDF test to run in non-RELEASE builds. |
| test/EFCore.Cosmos.FunctionalTests/CosmosTransactionalBatchTest.cs | Skips oversized payload tests on Linux emulator where behavior differs (timeouts). |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+121
to
+130
| { | ||
| if (ServiceProvider is IAsyncDisposable asyncDisposable) | ||
| { | ||
| await asyncDisposable.DisposeAsync(); | ||
| } | ||
| else if (ServiceProvider is IDisposable disposable) | ||
| { | ||
| disposable.Dispose(); | ||
| } | ||
| } |
Comment on lines
+1065
to
1077
| #if RELEASE | ||
| var exception = Assert.Throws<InvalidOperationException>( | ||
| () => context.Customers.Where(c => c.Id == UDFSqlContext.NullableValueReturnType()).ToList()); | ||
|
|
||
| Assert.Equal( | ||
| RelationalStrings.DbFunctionNullableValueReturnType( | ||
| context.Model.FindDbFunction(typeof(UDFSqlContext).GetMethod(nameof(UDFSqlContext.NullableValueReturnType)))!.ModelName, | ||
| context.Model.FindDbFunction(typeof(UDFSqlContext).GetMethod(nameof(UDFSqlContext.NullableValueReturnType))!)!.ModelName, | ||
| "int?"), | ||
| exception.Message); | ||
| } | ||
| #else | ||
| Assert.Throws<UnreachableException>( | ||
| () => context.Customers.Where(c => c.Id == UDFSqlContext.NullableValueReturnType()).ToList()); | ||
| #endif |
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.
Cleanup service providers proactively in tests