1111using Aspire . Dashboard . Model . Otlp ;
1212using Aspire . Dashboard . Otlp . Model ;
1313using Aspire . Dashboard . Otlp . Storage ;
14- using Aspire . TestUtilities ;
1514using Bunit ;
1615using Google . Protobuf . Collections ;
1716using Microsoft . AspNetCore . InternalTesting ;
@@ -31,6 +30,13 @@ public partial class TraceDetailsTests : DashboardTestContext
3130{
3231 private static readonly DateTime s_testTime = new ( 1970 , 1 , 1 , 0 , 0 , 0 , DateTimeKind . Utc ) ;
3332
33+ private readonly ITestOutputHelper _testOutputHelper ;
34+
35+ public TraceDetailsTests ( ITestOutputHelper testOutputHelper )
36+ {
37+ _testOutputHelper = testOutputHelper ;
38+ }
39+
3440 [ Fact ]
3541 public void Render_HasTrace_SubscriptionRemovedOnDispose ( )
3642 {
@@ -83,11 +89,13 @@ public void Render_HasTrace_SubscriptionRemovedOnDispose()
8389 }
8490
8591 [ Fact ]
86- [ QuarantinedTest ( "https://github.com/dotnet/aspire/issues/8546" ) ]
8792 public async Task Render_ChangeTrace_RowsRendered ( )
8893 {
8994 // Arrange
90- SetupTraceDetailsServices ( ) ;
95+ var loggerFactory = IntegrationTestHelpers . CreateLoggerFactory ( _testOutputHelper ) ;
96+ var logger = loggerFactory . CreateLogger ( nameof ( Render_ChangeTrace_RowsRendered ) ) ;
97+
98+ SetupTraceDetailsServices ( loggerFactory : loggerFactory ) ;
9199
92100 var viewport = new ViewportInformation ( IsDesktop : true , IsUltraLowHeight : false , IsUltraLowWidth : false ) ;
93101
@@ -125,21 +133,30 @@ public async Task Render_ChangeTrace_RowsRendered()
125133 } ) ;
126134
127135 // Assert
128- var grid = cut . FindComponent < FluentDataGrid < SpanWaterfallViewModel > > ( ) ;
129- var rows = grid . FindAll ( ".fluent-data-grid-row" , enableAutoRefresh : true ) ;
130-
131- await AsyncTestHelpers . AssertIsTrueRetryAsync ( ( ) => rows . Count == 3 , "Expected rows to be rendered." ) ;
136+ logger . LogInformation ( $ "Assert row count for '{ traceId } '") ;
137+ await AsyncTestHelpers . AssertIsTrueRetryAsync ( ( ) =>
138+ {
139+ var grid = cut . FindComponent < FluentDataGrid < SpanWaterfallViewModel > > ( ) ;
140+ var rows = grid . FindAll ( ".fluent-data-grid-row" ) ;
141+ return rows . Count == 3 ;
142+ } , "Expected rows to be rendered." , logger ) ;
132143
133144 traceId = Convert . ToHexString ( Encoding . UTF8 . GetBytes ( "2" ) ) ;
134145 cut . SetParametersAndRender ( builder =>
135146 {
136147 builder . Add ( p => p . TraceId , traceId ) ;
137148 } ) ;
138149
139- await AsyncTestHelpers . AssertIsTrueRetryAsync ( ( ) => rows . Count == 2 , "Expected rows to be rendered." ) ;
150+ logger . LogInformation ( $ "Assert row count for '{ traceId } '") ;
151+ await AsyncTestHelpers . AssertIsTrueRetryAsync ( ( ) =>
152+ {
153+ var grid = cut . FindComponent < FluentDataGrid < SpanWaterfallViewModel > > ( ) ;
154+ var rows = grid . FindAll ( ".fluent-data-grid-row" ) ;
155+ return rows . Count == 2 ;
156+ } , "Expected rows to be rendered." , logger ) ;
140157 }
141158
142- private void SetupTraceDetailsServices ( )
159+ private void SetupTraceDetailsServices ( ILoggerFactory ? loggerFactory = null )
143160 {
144161 var version = typeof ( FluentMain ) . Assembly . GetName ( ) . Version ! ;
145162
@@ -170,14 +187,16 @@ private void SetupTraceDetailsServices()
170187
171188 JSInterop . SetupVoid ( "initializeContinuousScroll" ) ;
172189
190+ loggerFactory ??= NullLoggerFactory . Instance ;
191+
173192 Services . AddLocalization ( ) ;
174193 Services . AddSingleton < BrowserTimeProvider , TestTimeProvider > ( ) ;
175194 Services . AddSingleton < PauseManager > ( ) ;
176195 Services . AddSingleton < TelemetryRepository > ( ) ;
177196 Services . AddSingleton < IMessageService , MessageService > ( ) ;
178197 Services . AddSingleton < IOptions < DashboardOptions > > ( Options . Create ( new DashboardOptions ( ) ) ) ;
179198 Services . AddSingleton < DimensionManager > ( ) ;
180- Services . AddSingleton < ILogger < StructuredLogs > > ( NullLogger < StructuredLogs > . Instance ) ;
199+ Services . AddSingleton < ILoggerFactory > ( loggerFactory ) ;
181200 Services . AddSingleton < IDialogService , DialogService > ( ) ;
182201 Services . AddSingleton < ISessionStorage , TestSessionStorage > ( ) ;
183202 Services . AddSingleton < ILocalStorage , TestLocalStorage > ( ) ;
0 commit comments