Skip to content

[ci-scan-net11] Essentials.AI.UnitTests — StreamingJsonDeserializerTests FileBasedTests fail with IOException (file locked) on Windows Helix (ne [Content truncated due to length] #36651

Description

@github-actions

Summary

StreamingJsonDeserializerTests+FileBasedTests unit tests in Microsoft.Maui.Essentials.AI.UnitTests consistently fail with System.IO.IOException due to a file being locked by another process when running in parallel on Windows Helix.

Build Information

  • Pipeline: maui-pr (ID 302)
  • Build: 1498916
  • Build ID: 1498916
  • Branch: net11.0
  • First seen: 2026-07-07 (build 1497603)
  • Occurrences: 2 in last 10 builds (1497603, 1498916)

Affected Legs

  • Windows Helix Unit Tests (Debug)Microsoft.Maui.Essentials.AI.UnitTests.dll on Windows (xUnit, Helix)

Error Message

Microsoft.Maui.Essentials.AI.UnitTests.StreamingJsonDeserializerTests+FileBasedTests.ProcessChunk_TxtFile_FinalResultMatchesDirectDeserialization(
    fileName: "sahara-itinerary-1.txt", ...) [FAIL]
  System.IO.IOException : The process cannot access the file
  'C:\h\w\...\TestData\DataStreams\Itinerary\sahara-itinerary-1.txt'
  because it is being used by another process.
  Stack Trace:
       at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(...)
       at System.IO.File.ReadAllLines(...)
       at FileBasedTests.ProcessChunk_TxtFile_FinalResultMatchesDirectDeserialization(...)

(Build 1498916): ProcessChunk_TxtFile_ShouldProgressDaysArray — same IOException on
  'maui-itinerary-2.txt' locked by another process.

Recommended Action

  1. The test reads .txt files from TestData\DataStreams\Itinerary\ using File.ReadAllLines. Multiple xUnit theories (parameterized test cases) likely share the same file path and run in parallel — the second opener hits the lock.
  2. Investigate src/AI/tests/Essentials.AI.UnitTests/Tests/StreamingJsonDeserializerTests/FileBasedTests.cs around line 44. Either:
    • Open the file with FileShare.Read instead of the default FileShare.None, or
    • Add [Collection("sequential")] / disable parallelism for FileBasedTests, or
    • Ensure each theory variant uses a distinct file copy.
  3. Confirm with: dotnet test ... --filter StreamingJsonDeserializerTests -- RunConfiguration.DisableParallelization=true to check whether sequential execution clears the failure.

Generated by CI Failure Scanner (net11.0) · 165.1 AIC · ⌖ 6.44 AIC · ⊞ 8.8K ·

Metadata

Metadata

Assignees

No one assigned

    Labels

    ci-scan-net11CI scanner findings for net11.0

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions