Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Tests | Fix SqlBatch Test Deadlocks#3025

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mdaigle merged 1 commit intodotnet:mainfromMichelZ:pr/batch_test
Mar 21, 2025

Conversation

MichelZ
Copy link
Contributor

AI Blurp

This pull request includes changes to theBatchTests.cs file to add retry logic for SQL commands and to enhance theSqlBatchCommand functionality. The most important changes are as follows:

Enhancements to SQL retry logic:

  • Added retry logic configuration usingSqlRetryLogicOption andSqlRetryLogicBaseProvider to handle transient errors like deadlocks by retrying the operation up to three times with a delay of 100 milliseconds.

Improvements toSqlBatchCommand:

  • ModifiedStoredProcedureBatchSupported andMixedBatchSupported methods to include parameters inSqlBatchCommand for executing stored procedures, specifically adding a parameter for thesp_help stored procedure.

Additional imports:

  • AddedSystem.Collections.Generic import to support the use ofList<SqlParameter> in the updated methods.

Description

I regularly see deadlocks for the tests that usesp_help.
I'll try to mitigate this in 2 different ways:

  • Add a retry for ErrorNumber 1205 (Deadlock)
  • Add a parameter@objname that does less work so it's less likely to get a deadlock

It can probably also be solved by just using another stored procedure that's not prone to deadlocks, but I chose this way as the easiest path

Example test failure:
https://sqlclientdrivers.visualstudio.com/public/_build/results?buildId=101959&view=logs&j=700ebecb-e440-5400-66bb-488206e790af&t=d8ae6a68-b967-5b1e-ef3d-1b53d82075ee&l=826

Add parameter to sp_help
@codecovCodecov
Copy link

codecovbot commentedNov 20, 2024
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.78%. Comparing base(b1f7eaf) to head(4ab317f).
Report is 85 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@##             main    #3025      +/-   ##==========================================+ Coverage   72.68%   72.78%   +0.09%==========================================  Files         285      332      +47       Lines       59155    83162   +24007     ==========================================+ Hits        42998    60530   +17532- Misses      16157    22632    +6475
FlagCoverage Δ
addons92.58% <ø> (ø)
netcore74.50% <ø> (-0.89%)⬇️
netfx71.76% <ø> (+0.63%)⬆️

Flags with carried forward coverage won't be shown.Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MichelZMichelZ changed the titleFix SqlBatch Test DeadlocksTests | Fix SqlBatch Test DeadlocksNov 25, 2024
@mdaiglemdaigle added Code Health 💊Issues/PRs that are targeted to source code quality improvements. Area\TestsIssues that are targeted to tests or test projects and removed Code Health 💊Issues/PRs that are targeted to source code quality improvements. labelsNov 25, 2024
@paulmedynski
Copy link
Contributor

/azp run

@paulmedynskipaulmedynski requested a review froma teamMarch 20, 2025 18:48
@azure-pipelinesAzure Pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@paulmedynskipaulmedynski self-assigned thisMar 21, 2025
@mdaiglemdaigle merged commita78b086 intodotnet:mainMar 21, 2025
130 checks passed
@mdaiglemdaigle added this to the7.0-preview1 milestoneMar 21, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@mdaiglemdaiglemdaigle approved these changes

@paulmedynskipaulmedynskipaulmedynski approved these changes

Assignees

@paulmedynskipaulmedynski

Labels
Area\TestsIssues that are targeted to tests or test projects
Projects
None yet
Milestone
6.1-preview1
Development

Successfully merging this pull request may close these issues.

3 participants
@MichelZ@paulmedynski@mdaigle

[8]ページ先頭

©2009-2025 Movatter.jp