Skip to content

Three Cosmos structural-equality tests flaky on Cosmos DB Emulator for Windows #39809

Backlog

Description

@ajcvickers

Note: this is flaky on the Windows emulator. It is likely not due to version upgrade.


Three Cosmos structural-equality tests started failing in the Cosmos (windows-2025) CI lane when the GitHub Windows runner image upgraded the Azure Cosmos DB Emulator from 2.14.28.0 to 2.14.29.0. Each query now returns 0 rows where 1 is expected. The same tests still pass in the Cosmos (ubuntu-24.04) lane, which uses the Linux (vnext) emulator.

Failing tests

  • OwnedComplexPropertiesStructuralEqualityCosmosTest.Contains_with_operators_composed_on_the_collection
  • ComplexPropertiesStructuralEqualityCosmosTest.Contains_with_operators_composed_on_the_collection
  • ComplexPropertiesStructuralEqualityCosmosTest.Contains_with_nested_and_composed_operators
Assert.Equal() Failure: Values differ
Expected: 1
Actual:   0

All three compare a whole JSON object with a parameter inside an EXISTS subquery that also has another predicate:

SELECT VALUE c
FROM root c
WHERE EXISTS (
    SELECT 1
    FROM n IN c["RequiredAssociate"]["NestedCollection"]
    WHERE ((n["Int"] > @get_Item_Int) AND (n = @entity_equality_get_Item)))

where @entity_equality_get_Item is a JSON object, e.g. {"Id":3003,"Int":108,"Ints":[8,9,109],"Name":"Root3_RequiredAssociate_NestedCollection_2","String":"foo104"}.

Evidence it's the emulator update

Runner image (windows-2025-vs2026) Cosmos emulator Windows Cosmos lane
20261116.315.1 2.14.28.0 Passed in every run checked on 2026-11-25 (~20 PR runs plus main)
20261123.321.1 2.14.29.0 Failed with exactly these three tests in both runs so far

As the new image rolls out, this will fail every PR that lands on it, so re-running doesn't help.

Possible actions

  • Skip these three tests on the Windows emulator for now. CosmosTestEnvironment has SkipOnLinuxEmulator but no Windows equivalent, so one would need adding. Then link an upstream report.
  • Check whether 2.14.29 changed object or document equality semantics inside EXISTS subqueries, and report it to the Cosmos emulator team if it's a regression.

Activity

  1. su-senka commented on Nov 26, 2026

    @su-senka

    I have a fix for this along the lines of the first suggested action: a new CosmosTestEnvironment.SkipOnWindowsEmulator helper, mirroring SkipOnLinuxEmulator, used to skip the three tests on the Windows emulator. The owned variant keeps running on the Linux emulator, where it passes.

  2. changed the title [-]Three Cosmos structural-equality tests fail on Cosmos DB Emulator 2.14.29 (Windows CI)[/-] [+]Three Cosmos structural-equality tests flaky on Cosmos DB Emulator for Windows[/+] on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions