Skip to content

Skip failing tests on Linux Cosmos emulator - #38808

Open
AndriySvyryd wants to merge 1 commit into
mainfrom
FlakyCosmos
Open

Skip failing tests on Linux Cosmos emulator#38808
AndriySvyryd wants to merge 1 commit into
mainfrom
FlakyCosmos

Conversation

@AndriySvyryd

Copy link
Copy Markdown
Member

Cleanup service providers proactively in tests

Cleanup service providers proactively in tests
@AndriySvyryd
AndriySvyryd requested review from cincuranet and a lite review from Copilot August 14, 2026 05:08
@AndriySvyryd
AndriySvyryd requested a review from a team as a code owner August 14, 2026 05:08
@AndriySvyryd
AndriySvyryd enabled auto-merge (squash) August 14, 2026 05:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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’s ServiceProvider during 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants