{"record":{"id":"5aadaeb7ecf92659","repo":"dotnet/maui","slug":"no-test-result-files-found-all-test-processes-may","errorCode":null,"errorMessage":"No test result files found. All test processes may have crashed or failed to start.","messagePattern":"No test result files found\\. All test processes may have crashed or failed to start\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"eng/devices/windows.cake","lineNumber":631,"sourceCode":"\n\tif (failedCategories.Any()) {\n\t\tError(\"✗ Failed or timed out categories:\");\n\t\tforeach (var category in failedCategories) {\n\t\t\tError($\"  - {category}\");\n\t\t}\n\t}\n\n\t// Clean up the test categories file\n\tif (FileExists(testsToRunFile))\n\t{\n\t\tDeleteFile(testsToRunFile);\n\t}\n\n\t// Check if we have any test result files at all\n\tvar actualResultFiles = System.IO.Directory.GetFiles(testResultsPath, \"TestResults-*.xml\");\n\tif (actualResultFiles.Length == 0)\n\t{\n\t\tthrow new Exception($\"No test result files found. All test processes may have crashed or failed to start.\");\n\t}\n\n\t// If we're running Controls tests, validate we have results for expected categories\n\tif (isControlsProjectTestRun && failedCategories.Any())\n\t{\n\t\tthrow new Exception($\"Some test categories failed to complete: {string.Join(\", \", failedCategories)}. Expected {completedCategories.Count + failedCategories.Count} categories, but {failedCategories.Count} failed.\");\n\t}\n\n\t// Check for test failures in the result files\n\tforeach(var file in actualResultFiles)\n\t{\n\t\tvar failed = XmlPeek(file, \"/assemblies/assembly[@failed > 0 or @errors > 0]/@failed\");\n\t\tif (!string.IsNullOrEmpty(failed)) {\n\t\t\tthrow new Exception($\"At least {failed} test(s) failed in {System.IO.Path.GetFileName(file)}.\");\n\t\t}\n\t}\n\n\tInformation($\"✓ All test executions completed successfully with {actualResultFiles.Length} result file(s)\");","sourceCodeStart":613,"sourceCodeEnd":649,"githubUrl":"https://github.com/dotnet/maui/blob/f377ff1c5ee04d334d8a925f50c83a6b7afddf03/eng/devices/windows.cake#L613-L649","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect the per-category Error/log lines above the throw to see which launches failed; if all failed, fix the launch/activation issue first.","List testResultsPath contents to confirm whether files exist under a different name or in a subdirectory.","Verify testResultsPath is absolute, exists, and is writable by the test process (packaged apps may need a writable app-data location).","Confirm the result-file naming convention still matches TestResults-*.xml after any app-side change."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// After all runs, verify result files exist and name the path\nvar results = System.IO.Directory.GetFiles(testResultsPath, \"TestResults-*.xml\");\nif (results.Length == 0)\n    throw new Exception($\"No TestResults-*.xml in {testResultsPath}. Verify the path and that any test actually ran.\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Make testResultsPath absolute and ensure it exists before running tests.","Confirm the result-file naming convention matches TestResults-*.xml.","Review per-category launch logs to confirm at least one run executed."],"tags":["cake","windows","test-results","validation","device-tests"],"backgroundTag":null,"analyzedSha":"f377ff1c5ee04d334d8a925f50c83a6b7afddf03","analyzedAt":"2026-08-13T14:26:18.069Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}