Skip to content

Cosmos: make invalid-session-token assertion emulator-agnostic; narrow Linux-emulator skips#38312

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/remove-skip-condition-cosmos-tests
Draft

Cosmos: make invalid-session-token assertion emulator-agnostic; narrow Linux-emulator skips#38312
Copilot wants to merge 3 commits into
mainfrom
copilot/remove-skip-condition-cosmos-tests

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 23, 2026

The Linux Cosmos emulator returns "The session token provided 'invalidtoken' is not valid." while Windows / real service return "... is invalid.", causing 21 tests in CosmosSessionTokensTest to fail under the Linux emulator. The class was previously gated wholesale on IsNotLinuxEmulator, masking which tests were actually blocked by emulator bugs.

Changes

  • Relax assertion to the common prefix that matches both wordings (7 call sites):
    Assert.Contains("The session token provided 'invalidtoken' is", ex.ResponseBody);
  • Drop class-level [CosmosCondition(CosmosCondition.IsNotLinuxEmulator)] from CosmosSessionTokensTest and CosmosNonSharedSessionTokenTests — most tests pass on Linux after the assertion fix.
  • Re-add targeted per-test skips for the 4 tests still hitting genuine Linux emulator bugs, with comments pointing at the upstream tracking issues:
    • // https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/322UseSessionTokens_uses_session_tokens, Read_item_session_not_found_throws_CosmosException
    • // https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/319Optimistic_concurrency_precondition_failure_updates_session_token

Copilot AI and others added 3 commits May 23, 2026 04:22
…ows emulator wording

Agent-Logs-Url: https://github.com/dotnet/efcore/sessions/45f81279-a6cc-4d8e-8d4c-4c8b5ef2dc56

Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
…iting emulator issues #322 and #319; remove diagnostic md files

Agent-Logs-Url: https://github.com/dotnet/efcore/sessions/773a262b-df07-464f-9364-92c079d190c7

Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
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