Attempt to fix test flickers and remove/silence teardown failures that pollute the log.#265
Open
MayaKirova wants to merge 3 commits into
Open
Attempt to fix test flickers and remove/silence teardown failures that pollute the log.#265MayaKirova wants to merge 3 commits into
MayaKirova wants to merge 3 commits into
Conversation
…any non-critical errors from the logs.
…d of a fixed delay.
Contributor
There was a problem hiding this comment.
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
Criticalduring 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); | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #249