dotnet/maui · error · Exception
Some tests failed. Check the logs or test results.
Error message
Some tests failed. Check the logs or test results.
What it means
Thrown at the end of the test-running loop after every test project has been attempted. The loop catches per-project exceptions, sets success=false, and logs 'Test project failed: <project>'. Only after the loop does it throw this aggregate message, meaning one or more test projects failed but the individual failures are reported earlier in the log, not in this exception.
Source
Thrown at eng/cake/dotnet.cake:302
{
continue;
}
foreach (var project in GetFiles(test))
{
try
{
RunTestWithLocalDotNet(project.FullPath, configuration, dotnetPath);
}
catch
{
success = false;
Error($"Test project failed: {project}");
}
}
}
if (!success)
throw new Exception("Some tests failed. Check the logs or test results.");
});
Task("dotnet-pack-maui")
.WithCriteria(RunPackTarget())
.Does(() =>
{
// We are passing a nuget folder with nuget locations
if (!string.IsNullOrEmpty(nugetSource))
{
EnsureDirectoryExists(nugetSource);
var originalNuget = File("./NuGet.config");
ReplaceTextInFiles(originalNuget, "<add key=\"local\" value=\"true\" />", "");
ReplaceTextInFiles(originalNuget, "LOCAL_PLACEHOLDER", nugetSource);
}
var sln = "./eng/Microsoft.Maui.Packages.slnf";
if (!IsRunningOnWindows())
{View on GitHub (pinned to f377ff1c5e)
Solutions
- Search the log upward for the most recent 'Test project failed: <path>' line and open that project's test results/binlog to identify the failing tests.
- Re-run only the failing test project locally with the same configuration and TFM to reproduce (RunTestWithLocalDotNet equivalent via `dotnet test`).
- If failures are environment-related (device/emulator/SDK), fix the environment first, then re-run the full target.
- If a test is genuinely broken, fix the test or product code and re-run.
Defensive patterns
Strategy: try-catch
Try / catch
try {
RunTestWithLocalDotNet(project.FullPath, configuration, dotnetPath);
} catch (Exception ex) {
// Preserve the original exception for diagnostics instead of swallowing it
failedProjects.Add((project, ex));
success = false;
}
// After loop, surface the collected exceptions in the aggregate throw Prevention
- Run the test target locally with the same config/TFM before pushing to catch failures early.
- Capture per-project binlogs so failed-project root causes are immediately available.
- Keep the aggregate exception message listing the failed project paths for faster triage.
When it happens
Trigger: Any RunTestWithLocalDotNet call inside the test iteration throws (MSBuild test execution returns non-zero, test runner reports failures, or the project fails to build/run). The catch swallows the original exception, sets success=false, and the post-loop guard throws.
Common situations: A flaky or genuinely failing unit/integration test in the MAUI Controls/Essentials test set; a test project that does not build under the current TFM/runtime; missing test dependencies (e.g. Android SDK, simulator) causing the test runner to exit non-zero.
Related errors
- If no app was specified, an app must be provided.
- Error: Building dotnet-samples with NativeAOT is only suppor
- UI Test application path not specified.
- UI Test application path not specified.
- No test assembly found.
AI-assisted analysis of dotnet/maui@f377ff1c5e (2026-08-13).
Data as JSON: /api/errors/f4e8cef14bd48df4.
Report an issue: GitHub.