dotnet/maui · error · Exception

No test result files found. All test processes may have cras

Error message

No test result files found. All test processes may have crashed or failed to start.

What it means

Thrown in final validation when System.IO.Directory.GetFiles(testResultsPath, 'TestResults-*.xml') returns zero files. After all category runs (or the single all-tests run), not a single result XML was produced — meaning every test process either failed to start, crashed before writing, or wrote to a different location. This is the catch-all 'nothing ran' guard before per-category and per-file checks.

Source

Thrown at eng/devices/windows.cake:631

	if (failedCategories.Any()) {
		Error("✗ Failed or timed out categories:");
		foreach (var category in failedCategories) {
			Error($"  - {category}");
		}
	}

	// Clean up the test categories file
	if (FileExists(testsToRunFile))
	{
		DeleteFile(testsToRunFile);
	}

	// Check if we have any test result files at all
	var actualResultFiles = System.IO.Directory.GetFiles(testResultsPath, "TestResults-*.xml");
	if (actualResultFiles.Length == 0)
	{
		throw new Exception($"No test result files found. All test processes may have crashed or failed to start.");
	}

	// If we're running Controls tests, validate we have results for expected categories
	if (isControlsProjectTestRun && failedCategories.Any())
	{
		throw new Exception($"Some test categories failed to complete: {string.Join(", ", failedCategories)}. Expected {completedCategories.Count + failedCategories.Count} categories, but {failedCategories.Count} failed.");
	}

	// Check for test failures in the result files
	foreach(var file in actualResultFiles)
	{
		var failed = XmlPeek(file, "/assemblies/assembly[@failed > 0 or @errors > 0]/@failed");
		if (!string.IsNullOrEmpty(failed)) {
			throw new Exception($"At least {failed} test(s) failed in {System.IO.Path.GetFileName(file)}.");
		}
	}

	Information($"✓ All test executions completed successfully with {actualResultFiles.Length} result file(s)");

View on GitHub (pinned to f377ff1c5e)

Solutions

  1. Inspect the per-category Error/log lines above the throw to see which launches failed; if all failed, fix the launch/activation issue first.
  2. List testResultsPath contents to confirm whether files exist under a different name or in a subdirectory.
  3. Verify testResultsPath is absolute, exists, and is writable by the test process (packaged apps may need a writable app-data location).
  4. Confirm the result-file naming convention still matches TestResults-*.xml after any app-side change.
Defensive patterns

Strategy: validation

Validate before calling

// After all runs, verify result files exist and name the path
var results = System.IO.Directory.GetFiles(testResultsPath, "TestResults-*.xml");
if (results.Length == 0)
    throw new Exception($"No TestResults-*.xml in {testResultsPath}. Verify the path and that any test actually ran.");

Prevention

When it happens

Trigger: All LaunchPackagedAndWait/StartProcess calls failed to launch the app; the app started but crashed before writing any TestResults-*.xml; testResultsPath points at the wrong directory; the app writes result files with a different naming pattern than TestResults-*.xml.

Common situations: TEST_APP/activation broken so no run produced output; results path misconfiguration (empty TEST_RESULTS defaulting to a non-existent dir); a code change altering the result-file naming; packaged app unable to write to testResultsPath due to sandboxing.

Related errors


AI-assisted analysis of dotnet/maui@f377ff1c5e (2026-08-13). Data as JSON: /api/errors/5aadaeb7ecf92659. Report an issue: GitHub.