Skip Cosmos vector/hybrid search tests on Linux emulator#38261
Open
roji wants to merge 2 commits into
Open
Conversation
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>
There was a problem hiding this comment.
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) whenTestEnvironment.IsLinuxEmulatorto avoid container-creation failures. - Switch vector index type from
FlattoDiskANNfor 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>
09ba9f4 to
190254f
Compare
| namespace Microsoft.EntityFrameworkCore.Query.Translations; | ||
|
|
||
| [CosmosCondition(CosmosCondition.DoesNotUseTokenCredential | CosmosCondition.IsNotEmulator)] | ||
| [CosmosCondition(CosmosCondition.DoesNotUseTokenCredential | CosmosCondition.IsNotEmulator | CosmosCondition.IsNotLinuxEmulator)] |
Member
There was a problem hiding this comment.
This already has CosmosCondition.IsNotEmulator, the new condition is redundant
AndriySvyryd
approved these changes
May 12, 2026
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.
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.