@@ -371,9 +371,10 @@ public async Task RemovesNewlinesFromExceptions()
371371 /// this test checks our JSON logs satisfy a minimal set of requirements:
372372 /// (1) Is JSON parseable
373373 /// (2) Contains minimal expected fields: EventId, TimeStamp, RoleInstance,
374- /// Tenant, SourceMoniker, Pid, Tid.
374+ /// Tenant, SourceMoniker, Pid, Tid, etc .
375375 /// (3) Ensure some Enums are printed correctly.
376376 /// (4) That we have logs from a variety of EventSource providers.
377+ /// (5) Ensure ActivityId and RelatedActivityId are eventually present.
377378 /// </summary>
378379 [ Fact ]
379380 [ Trait ( "Category" , PlatformSpecificHelpers . TestCategory ) ]
@@ -420,6 +421,9 @@ public async Task OutputsValidJSONLogs()
420421 bool foundEtwEventSourceLog = false ;
421422 bool foundDurableTaskCoreLog = false ;
422423
424+ bool foundActivityId = false ;
425+ bool foundRelatedActivityId = false ;
426+
423427 // Validating JSON outputs
424428 foreach ( string line in lines )
425429 {
@@ -428,11 +432,14 @@ public async Task OutputsValidJSONLogs()
428432
429433 // (2) Contains minimal expected fields
430434 List < string > keys = json . Properties ( ) . Select ( p => p . Name ) . ToList ( ) ;
435+ Assert . Contains ( "EventStampName" , keys ) ;
436+ Assert . Contains ( "EventPrimaryStampName" , keys ) ;
437+ Assert . Contains ( "ProviderName" , keys ) ;
438+ Assert . Contains ( "TaskName" , keys ) ;
431439 Assert . Contains ( "EventId" , keys ) ;
432440 Assert . Contains ( "TimeStamp" , keys ) ;
433441 Assert . Contains ( "RoleInstance" , keys ) ;
434442 Assert . Contains ( "Tenant" , keys ) ;
435- Assert . Contains ( "SourceMoniker" , keys ) ;
436443 Assert . Contains ( "Pid" , keys ) ;
437444 Assert . Contains ( "Tid" , keys ) ;
438445
@@ -451,6 +458,18 @@ public async Task OutputsValidJSONLogs()
451458 foundAzureStorageLog = true ;
452459 }
453460
461+ // recording if ActivityId and RelatedActivityId are seen
462+ // we expect to see them, at some point, in a trivial orchestrator
463+ if ( keys . Contains ( "ActivityId" ) )
464+ {
465+ foundActivityId = true ;
466+ }
467+
468+ if ( keys . Contains ( "RelatedActivityId" ) )
469+ {
470+ foundRelatedActivityId = true ;
471+ }
472+
454473 // (3) Ensure some Enums are printed correctly: as strings
455474 string eventType = ( string ) json . GetValue ( "EventType" ) ;
456475 if ( ! string . IsNullOrEmpty ( eventType ) )
@@ -464,6 +483,10 @@ public async Task OutputsValidJSONLogs()
464483 Assert . True ( foundEtwEventSourceLog ) ;
465484 Assert . True ( foundDurableTaskCoreLog ) ;
466485
486+ // (5) Ensure ActivityId and RelatedActivityId are present in logs
487+ Assert . True ( foundActivityId ) ;
488+ Assert . True ( foundRelatedActivityId ) ;
489+
467490 // To ensure other tests generate the path
468491 File . Delete ( LinuxAppServiceLogger . LoggingPath ) ;
469492 }
0 commit comments