Skip to content

Conversation

@AndriySvyryd
Copy link
Member

@AndriySvyryd AndriySvyryd commented Nov 7, 2025

Don't skip tests if emulator not available

Fixes #19973

@AndriySvyryd AndriySvyryd requested a review from a team November 7, 2025 03:36
@AndriySvyryd
Copy link
Member Author

Don't skip tests if emulator not available
@AndriySvyryd AndriySvyryd enabled auto-merge (squash) December 17, 2025 01:01
@AndriySvyryd
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copilot AI review requested due to automatic review settings January 12, 2026 20:29
Copy link

Copilot AI left a comment

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 configures the Cosmos DB emulator to use port 8800 specifically for Helix CI runs and adds a mechanism to skip connection checks to prevent tests from being skipped when the emulator is not immediately available.

Changes:

  • Adds a SkipConnectionCheck configuration flag that bypasses connection availability checks
  • Configures Helix Windows builds to use port 8800 for the Cosmos emulator and skip connection checks
  • Simplifies the GitHub Actions Cosmos test workflow by combining restore, build, and test into a single command

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
test/EFCore.Cosmos.FunctionalTests/TestUtilities/TestEnvironment.cs Adds SkipConnectionCheck property to read configuration for bypassing connection checks
test/EFCore.Cosmos.FunctionalTests/TestUtilities/CosmosTestStore.cs Updates IsConnectionAvailableAsync to return true immediately when SkipConnectionCheck is enabled
eng/helix.proj Adds Cosmos test configuration for Windows Helix queues with port 8800 and connection check skip
.github/workflows/TestCosmos.yaml Simplifies workflow by combining build and test steps, adds SkipConnectionCheck environment variable

<EnableAzurePipelinesReporter>true</EnableAzurePipelinesReporter>
<FailOnTestFailure>true</FailOnTestFailure>
<SqlServerTests>$(RepoRoot)/test/EFCore.SqlServer.FunctionalTests/*.csproj;$(RepoRoot)/test/EFCore.SqlServer.HierarchyId.Tests/*.csproj;$(RepoRoot)/test/EFCore.OData.FunctionalTests/*.csproj;$(RepoRoot)/test/EFCore.AspNet.SqlServer.FunctionalTests/*.csproj;$(RepoRoot)/test/EFCore.VisualBasic.FunctionalTests/*.vbproj</SqlServerTests>
<CosmosTests>$(RepoRoot)/test/EFCore.Cosmos.FunctionalTests/*.csproj;</CosmosTests>
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

The trailing semicolon after the wildcard pattern is unnecessary and could potentially cause issues with path matching. MSBuild property values typically don't require a trailing semicolon unless multiple values are being concatenated. This should be <CosmosTests>$(RepoRoot)/test/EFCore.Cosmos.FunctionalTests/*.csproj</CosmosTests> without the trailing semicolon.

Copilot uses AI. Check for mistakes.
<!-- Set Cosmos emulator connection on Windows -->
<ItemGroup Condition = "'$(HelixTargetQueue.StartsWith(`Windows`))'">
<XUnitProject Update="$(CosmosTests)">
<PreCommands>$(PreCommands);set Test__Cosmos__SkipConnectionCheck=true;set Test__Cosmos__DefaultConnection=https://localhost:8800</PreCommands>
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

The PreCommands string is missing spaces after the semicolons between commands. While this may work on Windows (since the semicolon terminates the command), it's better practice to add spaces for readability. Consider: $(PreCommands);set Test__Cosmos__SkipConnectionCheck=true; set Test__Cosmos__DefaultConnection=https://localhost:8800

Suggested change
<PreCommands>$(PreCommands);set Test__Cosmos__SkipConnectionCheck=true;set Test__Cosmos__DefaultConnection=https://localhost:8800</PreCommands>
<PreCommands>$(PreCommands); set Test__Cosmos__SkipConnectionCheck=true; set Test__Cosmos__DefaultConnection=https://localhost:8800</PreCommands>

Copilot uses AI. Check for mistakes.
@AndriySvyryd
Copy link
Member Author

The tests are now failing with

       Microsoft.EntityFrameworkCore.Storage.RetryLimitExceededException : The maximum number of retries (10) was exceeded while executing database operations with 'TestCosmosExecutionStrategy'. See the inner exception for the most recent failure.
      ---- Microsoft.Azure.Cosmos.CosmosException : Response status code does not indicate success: ServiceUnavailable (503); Substatus: 20003; ActivityId: ad961a25-4cb0-4a83-b8ab-21017b93f97e; Reason: (GatewayStoreClient Request Timeout. Start Time UTC:1/12/2026 10:43:24 PM; Total Duration:36003.5648 Ms; Request Timeout 20000 Ms; Http Client Timeout:1200000 Ms; Activity id: ad961a25-4cb0-4a83-b8ab-21017b93f97e;);; Diagnostics:{"Summary":{},"name":"Account Read","start datetime":"2026-01-12T22:43:24.301Z","duration in milliseconds":36002.4951}
      --------- System.Threading.Tasks.TaskCanceledException : The operation was canceled.
      ------------ System.Threading.Tasks.TaskCanceledException : The operation was canceled.
      ---------------- System.IO.IOException : Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request..
      -------------------- System.Net.Sockets.SocketException : The I/O operation has been aborted because of either a thread exit or an application request.

@roji roji force-pushed the main branch 2 times, most recently from 249ae47 to 6b86657 Compare January 13, 2026 17:46
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.

Run Cosmos tests on Helix

4 participants