Skip to content

Fix flaky SequentialAccess test with dynamic expected value#4224

Open
ShreyaLaxminarayan wants to merge 1 commit intodotnet:mainfrom
ShreyaLaxminarayan:cbtotalfix
Open

Fix flaky SequentialAccess test with dynamic expected value#4224
ShreyaLaxminarayan wants to merge 1 commit intodotnet:mainfrom
ShreyaLaxminarayan:cbtotalfix

Conversation

@ShreyaLaxminarayan
Copy link
Copy Markdown
Contributor

Description:
The SequentialAccess test in DataStreamTest.cs was asserting a hardcoded byte count (536198) for the result of
SELECT * FROM orders FOR XML AUTO.
This value was tied to a specific state of the Northwind database and would fail whenever the Orders table content differed across test environments or servers.

Fix:
Replace the hardcoded expected value with a dynamically computed baseline using a direct SQL query, independent of the C# APIs under test.
-All 4 hardcoded assertions replaced with expectedTotal

Description:
The SequentialAccess test in DataStreamTest.cs was asserting a hardcoded byte count (536198) for the result of SELECT * FROM orders FOR XML AUTO.
This value was tied to a specific state of the Northwind database and would fail whenever the Orders table content differed across test environments or servers.

Fix:
Replace the hardcoded expected value with a dynamically computed baseline using a direct SQL query, independent of the C# APIs under test.
-All 4 hardcoded assertions replaced with expectedTotal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To triage

Development

Successfully merging this pull request may close these issues.

1 participant