dotnet / aspire

Tools, templates, and packages to accelerate building observable, production-ready apps
https://learn.microsoft.com/dotnet/aspire
MIT License
3.93k stars 479 forks source link

Test Failure: ResourceName_ViaUrlAndResourceLoaded_LogViewerUpdated #5922

Closed mitchdenny closed 1 month ago

mitchdenny commented 2 months ago

The following test failed in one of my PRs. Looked unrelated to my change, but its also only occured once so creating this issue to track.

https://github.com/dotnet/aspire/blob/cc9c8f3e657fb19b02cbaef0560c84ee8a062690/tests/Aspire.Dashboard.Components.Tests/Pages/ConsoleLogsTests.cs#L91

Here is the build that failed:

https://dev.azure.com/dnceng-public/public/_build/results?buildId=817744&view=ms.vss-test-web.build-test-results-tab

And incase that gets deleted due to retention policy, here is the exception:

Bunit.Extensions.WaitForHelpers.WaitForFailedException : The state predicate did not pass before the timeout period passed. Check count: 0. Component render count: 1. Total render count: 2.

Stack Trace:

   at Bunit.RenderedFragmentWaitForHelperExtensions.WaitForState(IRenderedFragmentBase renderedFragment, Func`1 statePredicate, Nullable`1 timeout) in /_/src/bunit.core/Extensions/WaitForHelpers/RenderedFragmentWaitForHelperExtensions.cs:line 32
   at Aspire.Dashboard.Components.Tests.Pages.ConsoleLogsTests.ResourceName_ViaUrlAndResourceLoaded_LogViewerUpdated() in /_/tests/Aspire.Dashboard.Components.Tests/Pages/ConsoleLogsTests.cs:line 127
--- End of stack trace from previous location ---
mitchdenny commented 2 months ago

/cc @JamesNK

BTW, this test passes locally for me - and so far on run until failure I'm not seeing any errors.

JamesNK commented 2 months ago
  Failed Aspire.Dashboard.Components.Tests.Pages.ConsoleLogsTests.ResourceName_ViaUrlAndResourceLoaded_LogViewerUpdated [1 s]
  Error Message:
   Bunit.Extensions.WaitForHelpers.WaitForFailedException : The state predicate did not pass before the timeout period passed. Check count: 0. Component render count: 1. Total render count: 2.
  Stack Trace:
     at Bunit.RenderedFragmentWaitForHelperExtensions.WaitForState(IRenderedFragmentBase renderedFragment, Func`1 statePredicate, Nullable`1 timeout) in /_/src/bunit.core/Extensions/WaitForHelpers/RenderedFragmentWaitForHelperExtensions.cs:line 32
   at Aspire.Dashboard.Components.Tests.Pages.ConsoleLogsTests.ResourceName_ViaUrlAndResourceLoaded_LogViewerUpdated() in /_/tests/Aspire.Dashboard.Components.Tests/Pages/ConsoleLogsTests.cs:line 127
--- End of stack trace from previous location ---
  Standard Output Messages:
 | [0.008s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Initializing root component 0 (Bunit.Rendering.RootComponent)
 | [0.018s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Rendering component 0 of type Bunit.Rendering.RootComponent
 | [0.020s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Initializing component 1 (Bunit.Rendering.FragmentContainer) as child of 0 (Bunit.Rendering.RootComponent)
 | [0.021s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Rendering component 1 of type Bunit.Rendering.FragmentContainer
 | [0.021s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Initializing component 2 (Microsoft.AspNetCore.Components.CascadingValue`1[Aspire.Dashboard.Components.Resize.ViewportInformation]) as child of 1 (Bunit.Rendering.FragmentContainer)
 | [0.021s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Rendering component 2 of type Microsoft.AspNetCore.Components.CascadingValue`1[Aspire.Dashboard.Components.Resize.ViewportInformation]
 | [0.023s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Initializing component 3 (Aspire.Dashboard.Components.Pages.ConsoleLogs) as child of 2 (Microsoft.AspNetCore.Components.CascadingValue`1[Aspire.Dashboard.Components.Resize.ViewportInformation])
 | [0.027s] Microsoft.Extensions.Localization.ResourceManagerStringLocalizer Debug: ResourceManagerStringLocalizer searched for 'None' in 'Aspire.Dashboard.Resources.ControlsStrings' with culture 'en-US'.
 | [0.028s] Microsoft.Extensions.Localization.ResourceManagerStringLocalizer Debug: ResourceManagerStringLocalizer searched for 'ConsoleLogsLoadingResources' in 'Aspire.Dashboard.Resources.ConsoleLogs' with culture 'en-US'.
 | [0.033s] Aspire.Dashboard.Components.Pages.ConsoleLogs Debug: Received initial resource snapshot with 1 resources.
 | [0.034s] Microsoft.Extensions.Localization.ResourceManagerStringLocalizer Debug: ResourceManagerStringLocalizer searched for 'ConsoleLogsUnknownState' in 'Aspire.Dashboard.Resources.ConsoleLogs' with culture 'en-US'.
 | [0.049s] Aspire.Dashboard.Components.Pages.ConsoleLogs Debug: Selected console resource from name test-resource.
 | [0.050s] Aspire.Dashboard.Components.Pages.ConsoleLogs Debug: Loading task completed.
 | [0.052s] Aspire.Dashboard.Components.Pages.ConsoleLogs Debug: Initializing console logs view model.
 | [0.054s] Aspire.Dashboard.Components.Pages.ConsoleLogs Debug: New resource test-resource selected.
 | [0.054s] Aspire.Dashboard.Components.Pages.ConsoleLogs Debug: Waiting for log viewer to be available.
 | [0.056s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Rendering component 3 of type Aspire.Dashboard.Components.Pages.ConsoleLogs
 | [0.057s] Microsoft.Extensions.Localization.ResourceManagerStringLocalizer Debug: ResourceManagerStringLocalizer searched for 'ConsoleLogsSelectResourceToolbar' in 'Aspire.Dashboard.Resources.ConsoleLogs' with culture 'en-US'.
 | [0.057s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Initializing component 4 (Microsoft.AspNetCore.Components.Web.PageTitle) as child of 3 (Aspire.Dashboard.Components.Pages.ConsoleLogs)
 | [0.057s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Initializing component 5 (Aspire.Dashboard.Components.Layout.AspirePageContentLayout) as child of 3 (Aspire.Dashboard.Components.Pages.ConsoleLogs)
 | [0.057s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Rendering component 4 of type Microsoft.AspNetCore.Components.Web.PageTitle
 | [0.057s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Initializing component 6 (Microsoft.AspNetCore.Components.Sections.SectionContent) as child of 4 (Microsoft.AspNetCore.Components.Web.PageTitle)
 | [0.058s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Rendering component 5 of type Aspire.Dashboard.Components.Layout.AspirePageContentLayout
 | [0.058s] Microsoft.Extensions.Localization.ResourceManagerStringLocalizer Debug: ResourceManagerStringLocalizer searched for 'PageToolbarLandmark' in 'Aspire.Dashboard.Resources.ControlsStrings' with culture 'en-US'.
 | [0.058s] Microsoft.Extensions.Localization.ResourceManagerStringLocalizer Debug: ResourceManagerStringLocalizer searched for 'ConsoleLogsHeader' in 'Aspire.Dashboard.Resources.ConsoleLogs' with culture 'en-US'.
 | [0.058s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Initializing component 7 (Microsoft.FluentUI.AspNetCore.Components.FluentToolbar) as child of 5 (Aspire.Dashboard.Components.Layout.AspirePageContentLayout)
 | [0.059s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Initializing component 8 (Aspire.Dashboard.Components.LogViewer) as child of 5 (Aspire.Dashboard.Components.Layout.AspirePageContentLayout)
 | [0.060s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Rendering component 7 of type Microsoft.FluentUI.AspNetCore.Components.FluentToolbar
 | [0.061s] Microsoft.Extensions.Localization.ResourceManagerStringLocalizer Debug: ResourceManagerStringLocalizer searched for 'ResourceLabel' in 'Aspire.Dashboard.Resources.ControlsStrings' with culture 'en-US'.
 | [0.061s] Microsoft.Extensions.Localization.ResourceManagerStringLocalizer Debug: ResourceManagerStringLocalizer searched for 'LogStatusLabel' in 'Aspire.Dashboard.Resources.ConsoleLogs' with culture 'en-US'.
 | [0.061s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Initializing component 9 (Aspire.Dashboard.Components.Controls.ResourceSelect) as child of 7 (Microsoft.FluentUI.AspNetCore.Components.FluentToolbar)
 | [0.062s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Initializing component 10 (Microsoft.FluentUI.AspNetCore.Components.FluentLabel) as child of 7 (Microsoft.FluentUI.AspNetCore.Components.FluentToolbar)
 | [0.063s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Rendering component 8 of type Aspire.Dashboard.Components.LogViewer
 | [0.064s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Initializing component 11 (Microsoft.AspNetCore.Components.Web.Virtualization.Virtualize`1[Aspire.Hosting.ConsoleLogs.LogEntry]) as child of 8 (Aspire.Dashboard.Components.LogViewer)
 | [0.066s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Rendering component 9 of type Aspire.Dashboard.Components.Controls.ResourceSelect
 | [0.066s] Microsoft.Extensions.Localization.ResourceManagerStringLocalizer Debug: ResourceManagerStringLocalizer searched for 'ResourceLabel' in 'Aspire.Dashboard.Resources.ControlsStrings' with culture 'en-US'.
 | [0.066s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Initializing component 12 (Microsoft.FluentUI.AspNetCore.Components.FluentInputLabel) as child of 9 (Aspire.Dashboard.Components.Controls.ResourceSelect)
 | [0.067s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Initializing component 13 (Microsoft.FluentUI.AspNetCore.Components.FluentSelect`1[Aspire.Dashboard.Model.Otlp.SelectViewModel`1[Aspire.Dashboard.Model.ResourceTypeDetails]]) as child of 9 (Aspire.Dashboard.Components.Controls.ResourceSelect)
 | [0.067s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Rendering component 10 of type Microsoft.FluentUI.AspNetCore.Components.FluentLabel
 | [0.070s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Rendering component 11 of type Microsoft.AspNetCore.Components.Web.Virtualization.Virtualize`1[Aspire.Hosting.ConsoleLogs.LogEntry]
 | [0.071s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Rendering component 12 of type Microsoft.FluentUI.AspNetCore.Components.FluentInputLabel
 | [0.072s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Rendering component 13 of type Microsoft.FluentUI.AspNetCore.Components.FluentSelect`1[Aspire.Dashboard.Model.Otlp.SelectViewModel`1[Aspire.Dashboard.Model.ResourceTypeDetails]]
 | [0.072s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Initializing component 14 (Microsoft.AspNetCore.Components.CascadingValue`1[Microsoft.FluentUI.AspNetCore.Components.InternalListContext`1[Aspire.Dashboard.Model.Otlp.SelectViewModel`1[Aspire.Dashboard.Model.ResourceTypeDetails]]]) as child of 13 (Microsoft.FluentUI.AspNetCore.Components.FluentSelect`1[Aspire.Dashboard.Model.Otlp.SelectViewModel`1[Aspire.Dashboard.Model.ResourceTypeDetails]])
 | [0.072s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Rendering component 14 of type Microsoft.AspNetCore.Components.CascadingValue`1[Microsoft.FluentUI.AspNetCore.Components.InternalListContext`1[Aspire.Dashboard.Model.Otlp.SelectViewModel`1[Aspire.Dashboard.Model.ResourceTypeDetails]]]
 | [0.072s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Initializing component 15 (Microsoft.FluentUI.AspNetCore.Components.FluentInputLabel) as child of 14 (Microsoft.AspNetCore.Components.CascadingValue`1[Microsoft.FluentUI.AspNetCore.Components.InternalListContext`1[Aspire.Dashboard.Model.Otlp.SelectViewModel`1[Aspire.Dashboard.Model.ResourceTypeDetails]]])
 | [0.072s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Initializing component 16 (Microsoft.FluentUI.AspNetCore.Components.FluentOption`1[Aspire.Dashboard.Model.Otlp.SelectViewModel`1[Aspire.Dashboard.Model.ResourceTypeDetails]]) as child of 14 (Microsoft.AspNetCore.Components.CascadingValue`1[Microsoft.FluentUI.AspNetCore.Components.InternalListContext`1[Aspire.Dashboard.Model.Otlp.SelectViewModel`1[Aspire.Dashboard.Model.ResourceTypeDetails]]])
 | [0.072s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Initializing component 17 (Microsoft.FluentUI.AspNetCore.Components.FluentOption`1[Aspire.Dashboard.Model.Otlp.SelectViewModel`1[Aspire.Dashboard.Model.ResourceTypeDetails]]) as child of 14 (Microsoft.AspNetCore.Components.CascadingValue`1[Microsoft.FluentUI.AspNetCore.Components.InternalListContext`1[Aspire.Dashboard.Model.Otlp.SelectViewModel`1[Aspire.Dashboard.Model.ResourceTypeDetails]]])
 | [0.072s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Rendering component 15 of type Microsoft.FluentUI.AspNetCore.Components.FluentInputLabel
 | [0.072s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Rendering component 16 of type Microsoft.FluentUI.AspNetCore.Components.FluentOption`1[Aspire.Dashboard.Model.Otlp.SelectViewModel`1[Aspire.Dashboard.Model.ResourceTypeDetails]]
 | [0.072s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Initializing component 18 (Aspire.Dashboard.Components.Controls.ResourceSelectOptionTemplate) as child of 16 (Microsoft.FluentUI.AspNetCore.Components.FluentOption`1[Aspire.Dashboard.Model.Otlp.SelectViewModel`1[Aspire.Dashboard.Model.ResourceTypeDetails]])
 | [0.072s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Rendering component 17 of type Microsoft.FluentUI.AspNetCore.Components.FluentOption`1[Aspire.Dashboard.Model.Otlp.SelectViewModel`1[Aspire.Dashboard.Model.ResourceTypeDetails]]
 | [0.072s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Initializing component 19 (Aspire.Dashboard.Components.Controls.ResourceSelectOptionTemplate) as child of 17 (Microsoft.FluentUI.AspNetCore.Components.FluentOption`1[Aspire.Dashboard.Model.Otlp.SelectViewModel`1[Aspire.Dashboard.Model.ResourceTypeDetails]])
 | [0.072s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Rendering component 18 of type Aspire.Dashboard.Components.Controls.ResourceSelectOptionTemplate
 | [0.072s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Initializing component 20 (Microsoft.FluentUI.AspNetCore.Components.FluentStack) as child of 18 (Aspire.Dashboard.Components.Controls.ResourceSelectOptionTemplate)
 | [0.072s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Rendering component 19 of type Aspire.Dashboard.Components.Controls.ResourceSelectOptionTemplate
 | [0.072s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Initializing component 21 (Microsoft.FluentUI.AspNetCore.Components.FluentStack) as child of 19 (Aspire.Dashboard.Components.Controls.ResourceSelectOptionTemplate)
 | [0.073s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Rendering component 20 of type Microsoft.FluentUI.AspNetCore.Components.FluentStack
 | [0.073s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Rendering component 21 of type Microsoft.FluentUI.AspNetCore.Components.FluentStack
 | [0.077s] Bunit.Rendering.TestRenderer Debug: Component 0 has been rendered.
 | [0.079s] Aspire.Dashboard.Components.Pages.ConsoleLogs Debug: Log viewer ready.
 | [0.085s] Microsoft.AspNetCore.Components.RenderTree.Renderer Debug: Rendering component 11 of type Microsoft.AspNetCore.Components.Web.Virtualization.Virtualize`1[Aspire.Hosting.ConsoleLogs.LogEntry]
 | [0.086s] Bunit.Rendering.TestRenderer Debug: Component 0 has been rendered.
 | [0.086s] Bunit.Rendering.TestRenderer Debug: The initial render of component 0 is completed.
 | [0.087s] Aspire.Dashboard.Components.Tests.Pages.ConsoleLogsTests Information: Resource and subscription should be set immediately on first render.
 | [1.471s] Bunit.Extensions.WaitForHelpers.WaitForHelper Debug: The waiter for component 3 timed out.
 | [1.471s] Bunit.Extensions.WaitForHelpers.WaitForHelper Debug: The waiter for component 3 disposed.
JamesNK commented 1 month ago

Hasn't failed in the last two weeks. Closing for now. Reopen if it becomes a problem again.