Stabilize ServerFormsTest.CanWireUpINotifyPropertyChangedToEditContext Quarantine test - #68166
Stabilize ServerFormsTest.CanWireUpINotifyPropertyChangedToEditContext Quarantine test#68166vendasankarsf3945 wants to merge 2 commits into
Conversation
|
Thanks for your PR, @vendasankarsf3945. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
Interesting, this test is not blocked. @vendasankarsf3945, what was the failure rate before the fix? I am suspecting the issue you're trying to fix might be stale |
|
Hi @ilonatommy, We tried to reproduce the issue by running the test 100 times locally but couldn't replicate it. Based on the details in #62386 and the failure in build #1070994 with NoSuchElementException for .user-name, I applied an assumption-based fix. The root cause is that MountTestComponent only waits for the tag, not child elements. Under CI load, rendering can be slower than the 1-second implicit wait, causing the race condition. The fix adds an explicit Browser.Exists wait to ensure child elements are rendered before FindElement calls, matching the pattern used by other tests in the same file. The change is minimal and uses existing infrastructure. |
|
If there is not reproduction neither on CI nor on local machine, let's close it. |
Stabilize ServerFormsTest.CanWireUpINotifyPropertyChangedToEditContext Quarantine test
Description
This PR addresses failures in
Microsoft.AspNetCore.Components.E2ETest.ServerExecutionTests.ServerFormsTest.CanWireUpINotifyPropertyChangedToEditContext.The test could fail after mounting the
NotifyPropertyChangedValidationComponentbecause child elements (.user-name) were looked up immediately after the component mount completed, before the component's render output had finished painting child nodes. This resulted inOpenQA.Selenium.NoSuchElementExceptionbeing thrown for the.user-nameselector instead of the test reaching its assertions.To ensure the form's child inputs are present before subsequent
FindElementcalls, the test now waits explicitly for the.user-nameelement to exist after mounting the component.Validation / Investigation
CanWireUpINotifyPropertyChangedToEditContextscenario under high CI load.Browser.MountTestComponent<NotifyPropertyChangedValidationComponent>()and immediately invokedappElement.FindElement(By.ClassName("user-name")).MountTestComponentonly waits for the<app>tag to exist, not for child elements. On slower machines, the component's child render output was not yet in the DOM when theFindElementcall ran.NoSuchElementException.Browser.Exists(By.ClassName("user-name"))between the mount call and the subsequentFindElementcalls restores deterministic synchronization, matching the pattern used by other working tests in the same file.Changes
Browser.Exists(By.ClassName("user-name"))wait afterBrowser.MountTestComponent<NotifyPropertyChangedValidationComponent>()in theCanWireUpINotifyPropertyChangedToEditContexttest.FindElementcalls operate against a DOM that has finished rendering the form's child nodes.QuarantinedTestattribute now that the test is stabilized.Fixes #62386.