Skip to content

Attempt to fix test flickers and remove/silence teardown failures that pollute the log.#265

Open
MayaKirova wants to merge 3 commits into
masterfrom
mkirova/tests-improvements
Open

Attempt to fix test flickers and remove/silence teardown failures that pollute the log.#265
MayaKirova wants to merge 3 commits into
masterfrom
mkirova/tests-improvements

Conversation

@MayaKirova

Copy link
Copy Markdown
Contributor

Closes #249

@MayaKirova
MayaKirova marked this pull request as ready for review July 23, 2026 11:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 targets flaky Playwright-based integration tests in the Lite test bed by making property-setting assertions wait for an actual Blazor render instead of relying on tiny delays, and by reducing teardown noise from SignalR disposal during shutdown (Issue #249).

Changes:

  • Replace StateHasChanged() + Task.Delay(1) in the property test loop with a render-awaiting helper (WaitForRenderAsync) to reduce timing flicker.
  • Update Playwright teardown to navigate away/close the page before disposing the host, aiming to drop SignalR connections cleanly.
  • Filter specific ASP.NET Core SignalR/connection manager log categories down to Critical during tests to reduce teardown log pollution.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tests/IgniteUI.Blazor.Lite.TestBed/Components/Pages/Home.razor Adds a “wait for next render” mechanism and uses it in property testing to reduce timing-related mismatches.
tests/IgniteUI.Blazor.Lite.IntegrationTests/Infrastructure/BlazorPageTest.cs Improves teardown order by navigating away and closing the Playwright page before disposing the host/context.
tests/IgniteUI.Blazor.Lite.IntegrationTests/Infrastructure/BlazorApplicationFactory.cs Adds logging filters to suppress known teardown-time SignalR disposal noise.
Comments suppressed due to low confidence (1)

tests/IgniteUI.Blazor.Lite.TestBed/Components/Pages/Home.razor:281

  • WaitForRenderAsync overwrites pendingRender on every call. If a previous render is still in-flight (or times out) and a subsequent property set happens before it completes, the completion of the earlier render can incorrectly release the newer waiter, reintroducing the exact kind of flicker this is meant to fix. Reuse a single TCS while a render is pending (and only create a new one when none is pending).
        // new TaskCompletionSource that will wait for render
        var renderTcs = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
        this.pendingRender = renderTcs;

        // trigger StateHasChanged to request a render.

Comment on lines 42 to +45
protected override async Task OnAfterRenderAsync(bool firstRender)
{
this.pendingRender?.TrySetResult(true);

Comment on lines +50 to +55
if (Page != null)
{
await Page.GotoAsync("about:blank").ConfigureAwait(false);
await Page.CloseAsync().ConfigureAwait(false);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Look into bulk API tests flicker

2 participants