Skip to content

Bug: filesystem-wrapper-tests-open-repository-solution-file #940

Closed

Description

@drmoisan
  • Work Mode: minor-audit

Summary

Several UtilitiesCS.Test file-system wrapper tests locate the repository root at run time and open or enumerate the real TaskMaster.sln. This is the same defect class that #931 (PR #939) fixed in FileInfoWrapper_Tests: the outcome of a unit test depends on repository layout and on whether another process holds the solution file open.

Environment

  • OS/version: Windows 11 (local) and windows-latest (CI)
  • Python version: n/a (C# / MSTest, .NET Framework 4.8)
  • Command/flags used: Invoke-MSTestWithCoverage.ps1 (parallel run, Workers=0, Scope=ClassLevel)
  • Data source or fixture: the repository's own TaskMaster.sln

Steps to Reproduce

  1. Hold TaskMaster.sln open with a share mode that excludes readers (for example a resident MSBuild node or an IDE).
  2. Run UtilitiesCS.Test with the standard coverage route.
  3. Alternatively, run the test assembly from a location whose ancestors contain no TaskMaster.sln.

Expected Behavior

The wrapper tests verify wrapper delegation through test-owned fixtures or mocks, independent of repository layout and of other processes.

Actual Behavior

  • UtilitiesCS.Test/HelperClasses/PhysicalFileSystemAdapters_Tests.cs walks up to the repository root (line ~361), builds a FileInfo over TaskMaster.sln (line ~376), asserts it is enumerated (lines 110-129), and swallows IOException in places, which hides the contention instead of removing it.
  • UtilitiesCS.Test/HelperClasses/DirectoryInfoWrapper_Tests.cs asserts that TaskMaster.sln is enumerated from the repository root (lines 60 and 79, root walk at line ~381).

Logs / Screenshots

Impact / Severity

  • Blocker
  • High
  • Medium
  • Low

Source

From: docs/features/potential/2026-09-29-filesystem-wrapper-tests-open-repository-solution-file.md

Activity

  1. drmoisan commented on Sep 30, 2026

    @drmoisan
    OwnerAuthor

    Restoring sections dropped by the promotion tooling.

    Suspected Cause / Notes

    A unit test depends on environment state it does not control, which is the root cause recorded for #931 (PR #939). Other root-walk sites to triage under the same fix:

    • TaskMaster.Test/Ribbon/RibbonControllerTests.cs:429
    • TaskMaster.Test/Bootstrap/FSharpCoreHintPathAlignmentTests.cs:27
    • UtilitiesCS.Test/EmailIntelligence/SortEmail_Tests.cs:405

    Some of these may legitimately read repository files, for example build-configuration alignment tests. Classify each one before changing it.

    Source: docs/features/active/2026-09-28-tests-depend-on-uncontrolled-environment-931/evidence/qa-gates/p4-t13-follow-up-handoff.2026-09-29T09-46.md.

    Proposed Fix / Validation Ideas

    • Reuse the Bug: tests-depend-on-uncontrolled-environment #931 pattern: exercise delegation through the internal IFileInfo/IDirectoryInfo seams with Moq, or through a test-owned stream opened with FileShare.ReadWrite. Use no temporary files.
    • Remove the IOException swallowing in PhysicalFileSystemAdapters_Tests.
    • Negative control: show that each rewritten test fails against a deliberately broken wrapper.
  2. drmoisan commented on Sep 30, 2026

    @drmoisan
    OwnerAuthor

    Delivered by PR 955 (merge commit 039cf77), parallel run bugs-2026-09-28. All 8 acceptance criteria in issue.md are checked off (AC8 amended per coordinator ruling to the per-file no-regression rule, with a dated note); all seven checks green on head b95a061 (run 36740921329) before merge. Follow-ups are filed separately by the run coordinator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions