Skip to content

Skip Cosmos vector/hybrid search tests on Linux emulator#38261

Open
roji wants to merge 2 commits into
mainfrom
roji/cosmos-vector-search-failures
Open

Skip Cosmos vector/hybrid search tests on Linux emulator#38261
roji wants to merge 2 commits into
mainfrom
roji/cosmos-vector-search-failures

Conversation

@roji
Copy link
Copy Markdown
Member

@roji roji commented May 12, 2026

The Linux emulator doesn't currently support vector search: Azure/azure-cosmos-db-emulator-docker#162. I'm not sure what/how exactly was passing before, but this PR disables these until support is properly added.

The vnext-preview Cosmos Linux emulator Docker image was updated
between May 8-11, 2026. It now rejects 'flat' and 'quantizedFlat'
vector index types (only 'diskANN' claimed as supported), and rejects
'uint8'/'int8' embedding data types (only 'float32'/'float16').

However, diskANN itself also doesn't work - container creation with
diskANN vector indexes returns a 500 InternalServerError with
PostgresError(SqlState(E42704)). This is an emulator bug.

The fix:
- Keep vector embedding config (IsVectorProperty) unconditionally so
  VectorDistance() translation is still tested
- Make all vector index config (IsVectorIndex/HasVectorIndex)
  conditional on !TestEnvironment.IsLinuxEmulator
- Make byte/sbyte embedding config conditional (unsupported data types)
- Skip byte/sbyte vector tests with [CosmosCondition(IsNotLinuxEmulator)]
- Change index type from Flat to DiskANN for non-emulator environments

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 12, 2026 18:19
@roji roji requested a review from a team as a code owner May 12, 2026 18:19
Copy link
Copy Markdown

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

Adjusts Cosmos vector search functional tests to accommodate breaking/buggy vector index behavior in the current Linux Cosmos emulator image while preserving coverage for VectorDistance() query translation.

Changes:

  • Skip byte/sbyte vector-distance tests on the Linux emulator via CosmosCondition.IsNotLinuxEmulator.
  • Disable all vector index creation (IsVectorIndex) when TestEnvironment.IsLinuxEmulator to avoid container-creation failures.
  • Switch vector index type from Flat to DiskANN for non-Linux-emulator environments.

Reviewed changes

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

File Description
test/EFCore.Cosmos.FunctionalTests/Query/Translations/VectorSearchTranslationsCosmosTest.cs Skips byte/sbyte vector tests on Linux emulator and conditionally avoids vector index creation while keeping float vector properties for query translation coverage.
test/EFCore.Cosmos.FunctionalTests/Query/Translations/HybridSearchTranslationsCosmosTest.cs Updates vector index type to DiskANN and adds Linux-emulator gating (though this file already has a class-level IsNotEmulator condition).

The vnext-preview Cosmos Linux emulator doesn't support vector search
(neither vector indexes nor byte/sbyte embedding data types), so skip
the entire test classes on the Linux emulator.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@roji roji force-pushed the roji/cosmos-vector-search-failures branch from 09ba9f4 to 190254f Compare May 12, 2026 18:42
Copilot AI review requested due to automatic review settings May 12, 2026 18:42
@roji roji changed the title Skip vector indexes on Linux emulator (diskANN broken) Skip Cosmos vector/hybrid search tests on Linux emulator May 12, 2026
@roji roji enabled auto-merge (squash) May 12, 2026 18:44
Copy link
Copy Markdown

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

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

namespace Microsoft.EntityFrameworkCore.Query.Translations;

[CosmosCondition(CosmosCondition.DoesNotUseTokenCredential | CosmosCondition.IsNotEmulator)]
[CosmosCondition(CosmosCondition.DoesNotUseTokenCredential | CosmosCondition.IsNotEmulator | CosmosCondition.IsNotLinuxEmulator)]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This already has CosmosCondition.IsNotEmulator, the new condition is redundant

@AndriySvyryd AndriySvyryd disabled auto-merge May 12, 2026 23:45
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.

3 participants