Skip to content

Commit a7959e3

Browse files
committed
Work around intermittent failure.
Sometimes `dotnet xunit` produces no output, so keep running it until it does.
1 parent 5df947b commit a7959e3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/AdoNetApiTest/Program.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,14 @@ static async Task Main()
9292
var folderName = Regex.Match(Path.GetFileName(testFolder), @"^(.*?)\.Tests").Groups[1].Value;
9393
var outputXmlPath = Path.Combine(testFolder, "bin", "output.xml");
9494
File.Delete(outputXmlPath);
95-
await RunXunitAsync(testFolder, outputXmlPath).ConfigureAwait(false);
95+
do
96+
{
97+
await RunXunitAsync(testFolder, outputXmlPath).ConfigureAwait(false);
98+
Console.Write(".");
99+
} while (!File.Exists(outputXmlPath));
96100
var outputXml = XDocument.Load(outputXmlPath);
97101
var testResults = CreateTestResults(outputXml);
98102
var connectorName = GetConnectorName(testFolder);
99-
Console.Write(".");
100103
return((connectorName ?? folderName, testResults));
101104
}
102105

@@ -151,6 +154,8 @@ private static IReadOnlyDictionary<string, TestResult> CreateTestResults(XDocume
151154
var actual = Regex.Match(message, @"\\nActual:\s+(.*?)$").Groups[1].Value;
152155
testStatus = actual == "(No exception was thrown)" ? TestStatus.NoException :
153156
actual.StartsWith("typeof(System.NullReferenceException)", StringComparison.Ordinal) ? TestStatus.Exception :
157+
actual.StartsWith("typeof(System.NotSupportedException)", StringComparison.Ordinal) ? TestStatus.Exception :
158+
actual.StartsWith("typeof(System.NotImplementedException)", StringComparison.Ordinal) ? TestStatus.Exception :
154159
TestStatus.WrongException;
155160
if (testStatus != TestStatus.NoException)
156161
testMessage = Regex.Replace(actual, @"^typeof\((.*?)\)(.*)$", "$1$2");

0 commit comments

Comments
 (0)