Skip to content

Fix integration test failures: Conversations table PK and stale attack_identifier references - #2024

Merged
hannahwestra25 merged 1 commit into
microsoft:mainfrom
hannahwestra25:hannahwestra25/fix-conversations-migration-varchar-max
Jun 16, 2026
Merged

hannahwestra25 merged 1 commit into
microsoft:mainfrom
hannahwestra25:hannahwestra25/fix-conversations-migration-varchar-max

Conversation

@hannahwestra25

@hannahwestra25 hannahwestra25 commented Jun 16, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Integration tests had 8 ERRORs and 5+ FAILEDs caused by two issues:

  1. VARCHAR(max) as primary key in SQL Server — The b2f4c6a8d1e3 migration creates conversation_id as sa.String() (no length), which maps to VARCHAR(max) on MSSQL. SQL Server cannot use VARCHAR(max) as a primary key (error 1919). This broke all 8 test_azure_sql_memory_integration tests.

  2. Stale attack_identifier references — MessagePiece now uses extra='forbid' and no longer has an attack_identifier field, but several integration test files still referenced it. This caused ValidationError / AttributeError in 5+ tests including the GPT-5 response tests, rate limiting test, and retry timing test.

Fix

  1. Added a new migration (d4e5f6a7b8c9) that alters Conversations.conversation_id from String() to String(36). Updated ConversationEntry model to match.

  2. Removed attack_identifier from MockPromptTarget (set_system_prompt and _send_prompt_to_target_async) and from MessagePiece constructors in test_openai_responses_gpt5.py.

…ck_identifier

Add new migration (d4e5f6a7b8c9) to alter Conversations.conversation_id
from unbounded String to String(36) for SQL Server PK compatibility.
VARCHAR(max) cannot be used as a primary key in SQL Server (error 1919).
Also update ConversationEntry model to match.

Remove stale attack_identifier references from integration test mocks
and GPT-5 tests. MessagePiece now uses extra='forbid' and no longer
has an attack_identifier field.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@hannahwestra25
hannahwestra25 force-pushed the hannahwestra25/fix-conversations-migration-varchar-max branch from da4d6e5 to f10a27a Compare June 16, 2026 15:56

@behnam-o Behnam (behnam-o) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

looks good, thank you!

@hannahwestra25
hannahwestra25 enabled auto-merge June 16, 2026 16:03
@hannahwestra25
hannahwestra25 added this pull request to the merge queue Jun 16, 2026
Merged via the queue into microsoft:main with commit f4e4b24 Jun 16, 2026
53 checks passed
@hannahwestra25
hannahwestra25 deleted the hannahwestra25/fix-conversations-migration-varchar-max branch June 16, 2026 16:27
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