Skip to content

Conversation

@pavelsavara
Copy link
Member

fix fallout of dotnet/xharness#1388

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR aims to update the XHarness test runner to use asynchronous return types for writing test results in response to fallout from a previous change.

  • Updated WriteResultsToFile(XmlResultJargon) to return Task instead of a synchronous string.
  • Updated WriteResultsToFile(TextWriter, XmlResultJargon) to return Task instead of void.
Comments suppressed due to low confidence (2)

src/tests/Common/XHarnessRunnerLibrary/GeneratedTestRunner.cs:55

  • Although the method now returns a Task, it still performs synchronous file I/O. Consider using File.WriteAllTextAsync to fully support asynchronous operations.
File.WriteAllText(ResultsFileName, LastTestRun.GetTestResultOutput(_assemblyName));

src/tests/Common/XHarnessRunnerLibrary/GeneratedTestRunner.cs:72

  • The synchronous write call may block the execution thread even though the method returns a Task. If the TextWriter supports asynchronous operations, consider using WriteLineAsync.
writer.WriteLine(lastTestResults);

@pavelsavara pavelsavara merged commit 72a4c86 into dotnet:main Apr 16, 2025
69 of 73 checks passed
@pavelsavara pavelsavara deleted the fix_xharness branch April 16, 2025 21:36
@github-actions github-actions bot locked and limited conversation to collaborators May 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants