Skip to content

THROWAWAY: validate failure-diagnostics capture in CI (do not merge)#8

Draft
tyrielv wants to merge 2 commits into
masterfrom
tyrielv/ft-failure-diagnostics-citest
Draft

THROWAWAY: validate failure-diagnostics capture in CI (do not merge)#8
tyrielv wants to merge 2 commits into
masterfrom
tyrielv/ft-failure-diagnostics-citest

Conversation

@tyrielv

@tyrielv tyrielv commented Jul 10, 2026

Copy link
Copy Markdown
Owner

THROWAWAY — do not merge. CI-only validation of the failure-diagnostics
capture added in tyrielv/ft-failure-diagnostics.

This branch:

  • Adds FailureDiagnosticsSmokeTests, which mounts an enlistment and then
    Assert.Fail()s while the mount is still alive, so
    CaptureFailureDiagnostics writes a GVFS.Mount minidump and preserves the
    .gvfs/logs.
  • Restricts the functional test run to only that fixture and reduces the CI
    matrix to a single x64 job for speed.

Expected result: the Functional Tests job fails (by design), and a
FailureDiagnostics_Release_x64-0 artifact is uploaded containing the mount
.dmp and copied logs. That artifact is what we're validating.

Once verified, this branch and PR are discarded; the real change ships via
tyrielv/ft-failure-diagnostics.

tyrielv added 2 commits July 10, 2026 11:49
When a functional test fails because its GVFS.Mount is unreachable (a hang or
silent exit), we currently have no post-mortem data. Per-test enlistment
.gvfs/logs are deleted at teardown and only survive as full-file contents
inlined into the console by TestResultsHelper.OutputGVFSLogs -- lossy under
parallel fixtures and empty when the mount hung. There is no process dump, so a
mount deadlock leaves zero diagnostic signal.

On test failure only, into a CI-uploadable diagnostics directory:

- Capture a full-memory minidump of each still-running GVFS.Mount process for
  the failing enlistment (a hung mount is still alive at teardown). New
  Tools/MiniDump.cs P/Invokes MiniDumpWriteDump (dbghelp); Windows-only,
  best-effort, never throws. Full memory is required so managed call stacks are
  resolvable in WinDbg/SOS.

- Robustly copy the enlistment .gvfs/logs. A plain File.Copy is tried first; if
  the file is locked (a hung mount still holds its log open), fall back to a
  read-only shared handle (FileShare.ReadWrite | Delete) and copy whatever has
  been flushed -- partial content is still useful.

GVFSFunctionalTestEnlistment.CaptureFailureDiagnostics runs first in
DeleteEnlistment, gated on TestStatus.Failed, before the enlistment directory is
deleted. The mount-process PID discovery is extracted from KillMountProcess into
a shared GetMountProcessIds helper.

CI: functional-tests.yaml sets GVFS_TEST_DIAGNOSTICS_DIR and uploads it as a
FailureDiagnostics artifact with if: always().

Assisted-by: Claude Opus 4.8
Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
Temporary branch to validate the mount-dump + log-preservation capture in CI:

- Add FailureDiagnosticsSmokeTests: mounts an enlistment then Assert.Fail()s
  while the mount is still alive, so CaptureFailureDiagnostics writes a minidump
  and preserves the logs.
- Program.cs: restrict the run to only the FailureDiagnosticsSmoke category so
  CI exercises the diagnostics quickly instead of the full suite.
- functional-tests.yaml: reduce the matrix to a single x64 job and run all
  (smoke) tests in one slice.

Assisted-by: Claude Opus 4.8
Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
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.

1 participant