Skip to content

Conversation

oroztocil
Copy link
Member

@oroztocil oroztocil commented Sep 11, 2025

The RemoteRendererTest.ProcessBufferedRenderBatches_WritesRenders test occasionaly fails because one of the rendering tasks does not complete as expected. That means that the task either failed with an unhandled exception, or has not completed synchronously.

The PR quarantines the test and adds temporary logging of the task state to help us eventually get more insight into the underlying issue.

@github-actions github-actions bot added the area-blazor Includes: Blazor, Razor Components label Sep 11, 2025
@oroztocil oroztocil marked this pull request as ready for review September 11, 2025 16:07
@oroztocil oroztocil requested a review from a team as a code owner September 11, 2025 16:07
@Copilot Copilot AI review requested due to automatic review settings September 11, 2025 16:07
Copy link
Contributor

@Copilot 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 quarantines a flaky test (ProcessBufferedRenderBatches_WritesRenders) that occasionally fails due to rendering tasks not completing as expected, and adds temporary diagnostic logging to help debug the underlying issue.

  • Quarantines the failing test with appropriate tracking issue reference
  • Adds temporary logging to capture task state and exception details when the assertion fails

var message = $"Render task should succeed synchronously.\nStatus: '{status}'\nInner exception: '{innerException}'";
Assert.True(task.IsCompletedSuccessfully, message);
}

Assert.True(task.IsCompletedSuccessfully);
Copy link
Preview

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

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

The assertion on line 783 is redundant since line 780 already performs the same check. Remove the duplicate assertion to avoid confusion and reduce code duplication.

Suggested change
Assert.True(task.IsCompletedSuccessfully);

Copilot uses AI. Check for mistakes.

@@ -767,6 +769,17 @@ public Task SetParametersAsync(ParameterView parameters)
public void TriggerRender()
{
var task = _renderHandle.Dispatcher.InvokeAsync(() => _renderHandle.Render(_renderFragment));

// TODO: Remove the following block once ProcessBufferedRenderBatches_WritesRenders is fixed.
Copy link
Member

Choose a reason for hiding this comment

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

Why? Can't we keep this message for all the tests in case of failure?

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess we could. I didn't want to add anything into the "standard code path". But since its just test code, why not.

Comment on lines 771 to 782
var task = _renderHandle.Dispatcher.InvokeAsync(() => _renderHandle.Render(_renderFragment));

// TODO: Remove the following block once ProcessBufferedRenderBatches_WritesRenders is fixed.
if (!task.IsCompletedSuccessfully)
{
// Log the task state for debugging purposes.
var status = task.Status;
var innerException = task.Exception?.InnerException;
var message = $"Render task should succeed synchronously.\nStatus: '{status}'\nInner exception: '{innerException}'";
Assert.True(task.IsCompletedSuccessfully, message);
}

Copy link
Member

Choose a reason for hiding this comment

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

This is not really the "fix" for this. We need to find where it is going async.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, it is definitely not a fix. It is meant to help diagnosing the problem (as it is difficult to reproduce on demand).

@oroztocil
Copy link
Member Author

/backport to release/10.0

Copy link
Contributor

Started backporting to release/10.0: https://github.com/dotnet/aspnetcore/actions/runs/17671816698

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants