FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Use writable copies for LocalDB tests by matouskozak · Pull Request #7672 · dotnet/machinelearning · GitHub

Use writable copies for LocalDB tests - #7672

Merged
matouskozak merged 6 commits into
mainfrom
matouskozak-ci-smoke-test
Aug 13, 2026
Merged

Use writable copies for LocalDB tests#7672
matouskozak merged 6 commits into
mainfrom
matouskozak-ci-smoke-test

Conversation

matouskozak commented Aug 12, 2026
edited
Loading

Copy link
Copy Markdown
Member

Fixes #7657.

Summary

  • Copy the packaged Iris LocalDB data and log files to a per-test temporary directory.
  • Clear read-only attributes before LocalDB attaches and upgrades the copied files.
  • Use a unique database name so test runs cannot collide with an existing LocalDB attachment.
  • Drop the temporary database and remove its files after each test.
  • Always clear System.Data.SqlClient connection pools, including when dropping the database fails.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 6dd6e79f-ff2e-4596-ae45-1c842d45bd40
Copy packaged database files to a per-test temporary directory before attaching them so newer LocalDB versions can upgrade the files on Windows CI agents.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 6dd6e79f-ff2e-4596-ae45-1c842d45bd40
matouskozak changed the title Test CI with a no-op documentation change Use writable copies for LocalDB tests Aug 12, 2026
matouskozak and others added 2 commits August 12, 2026 14:41
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Drop each per-test database and remove its temporary files after the test, while logging cleanup failures without masking test results.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 6dd6e79f-ff2e-4596-ae45-1c842d45bd40
matouskozak marked this pull request as ready for review August 12, 2026 15:05
Copilot AI lite review requested due to automatic review settings August 12, 2026 15:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull request overview

This PR updates the DatabaseLoaderTests LocalDB setup to avoid CI failures caused by the packaged .mdf/.ldf files being attached read-only on some Windows images. It does this by copying the database files to a per-test temp location, clearing read-only attributes, using a unique database name per test, and attempting best-effort cleanup afterward.

Changes:

  • Copy TestDatabases LocalDB .mdf/.ldf files into a per-test temporary directory and make them writable before attaching.
  • Attach LocalDB using a unique database name per test run to prevent collisions.
  • Add test cleanup logic to drop the temporary LocalDB database and delete the temporary directory (logging failures).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

codecov Bot commented Aug 12, 2026
edited
Loading

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.31034% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.75%. Comparing base (548d4d0) to head (918f387).
⚠️ Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
test/Microsoft.ML.Tests/DatabaseLoaderTests.cs 79.31% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7672      +/-   ##
==========================================
+ Coverage   69.59%   69.75%   +0.16%     
==========================================
  Files        1484     1486       +2     
  Lines      273606   275790    +2184     
  Branches    27949    28199     +250     
==========================================
+ Hits       190410   192375    +1965     
- Misses      75832    75953     +121     
- Partials     7364     7462      +98     
Flag Coverage Δ
Debug 69.75% <79.31%> (+0.16%) ⬆️
production 63.92% <ø> (+0.08%) ⬆️
test 89.80% <79.31%> (+0.16%) ⬆️

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

Files with missing lines Coverage Δ
test/Microsoft.ML.Tests/DatabaseLoaderTests.cs 90.90% <79.31%> (-3.51%) ⬇️

... and 16 files with indirect coverage changes

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

Clear System.Data.SqlClient pools even when dropping a temporary test database fails, while preserving narrow cleanup exception handling.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 6dd6e79f-ff2e-4596-ae45-1c842d45bd40
matouskozak enabled auto-merge (squash) August 13, 2026 12:45

Copy link
Copy Markdown
Member Author

/ba-g failures are unrelate to this PR and will be addressed as follow up

matouskozak merged commit cd2fbd6 into main Aug 13, 2026
23 of 26 checks passed
matouskozak deleted the matouskozak-ci-smoke-test branch August 13, 2026 12:46
matouskozak added a commit that referenced this pull request Sep 8, 2026
Give each LocalDB test writable Iris database files and a unique database name. Clear connection pools and remove the temporary database and files during cleanup.

Backport of cd2fbd6.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b4d84f55-b1c1-4002-a5e7-e51f325e4811
matouskozak added a commit that referenced this pull request Sep 9, 2026
…7695)

Combine four existing CI fixes from main with the Arcade update from #7570 to restore release/5.0 CI:

- #7599: Replace removed OSX.13 Helix queues with osx.15 queues.
- #7653: Replace the retired Windows 2019 build image with Windows 2022, including code coverage.
- #7663: Replace broken test resource aliases with direct URLs and include the existing shared download helper and benchmark fixes.
- #7672: Use writable, per-test LocalDB database copies, unique database names, and cleanup to fix the read-only Iris database failures.
- #7570: Merge the Arcade update, including Arcade and Helix SDK version `10.0.0-beta.26453.2` and .NET SDK version `10.0.111`.

These changes address the failures in #7570 and the resource download problem tracked by #7662. The backported files match the original fixes. The Arcade merge also replaces the unavailable Helix SDK version `10.0.0-beta.26057.1`, which blocked all 20 jobs in the first run of this PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

DatabaseLoaderTests.Iris* fail: iris.mdf attached read-only on 1es-windows-2022-open image

3 participants


Back | FazBrowse Home | New Git URL