@@ -800,31 +800,38 @@ public async Task TracingInterceptor_Nexus_HasTracing()
800800 [ Fact ]
801801 public async Task TracingInterceptor_StandaloneActivity_HasProperSpans ( )
802802 {
803- var activityId = $ "act-{ Guid . NewGuid ( ) } ";
803+ var cancelId = $ "act-cancel-{ Guid . NewGuid ( ) } ";
804+ var terminateId = $ "act-terminate-{ Guid . NewGuid ( ) } ";
804805 var spans = await WithTracingWorkerAsync ( async ( client , _ ) =>
805806 {
806807 var taskQueue = $ "standalone-tq-{ Guid . NewGuid ( ) } ";
807- var handle = await client . StartActivityAsync (
808+
809+ var cancelHandle = await client . StartActivityAsync (
808810 "StandaloneActivity" ,
809811 Array . Empty < object ? > ( ) ,
810- new ( activityId , taskQueue )
811- {
812- ScheduleToCloseTimeout = TimeSpan . FromMinutes ( 5 ) ,
813- } ) ;
814- await handle . DescribeAsync ( ) ;
815- await handle . CancelAsync ( ) ;
816- await handle . TerminateAsync ( ) ;
817- await client . CountActivitiesAsync ( $ "ActivityId = '{ activityId } '") ;
812+ new ( cancelId , taskQueue ) { ScheduleToCloseTimeout = TimeSpan . FromMinutes ( 5 ) } ) ;
813+ await cancelHandle . DescribeAsync ( ) ;
814+ await cancelHandle . CancelAsync ( ) ;
815+
816+ var terminateHandle = await client . StartActivityAsync (
817+ "StandaloneActivity" ,
818+ Array . Empty < object ? > ( ) ,
819+ new ( terminateId , taskQueue ) { ScheduleToCloseTimeout = TimeSpan . FromMinutes ( 5 ) } ) ;
820+ await terminateHandle . TerminateAsync ( ) ;
821+
822+ await client . CountActivitiesAsync ( $ "TaskQueue = '{ taskQueue } '") ;
818823 } ) ;
819824
820- var activityTags = new [ ] { ActivityAssertion . TagEqual ( "temporalActivityID" , activityId ) } ;
825+ var cancelTags = new [ ] { ActivityAssertion . TagEqual ( "temporalActivityID" , cancelId ) } ;
826+ var terminateTags = new [ ] { ActivityAssertion . TagEqual ( "temporalActivityID" , terminateId ) } ;
821827 AssertActivities (
822828 spans ,
823- new ( "StartActivity:StandaloneActivity" , Parent : null , Tags : activityTags ) ,
824- new ( "DescribeActivity:" + activityId , Parent : null , Tags : activityTags ) ,
825- new ( "CancelActivity:" + activityId , Parent : null , Tags : activityTags ) ,
826- new ( "TerminateActivity:" + activityId , Parent : null , Tags : activityTags ) ,
827- new ( Name : "CountActivities" , Parent : null , IgnoreTags : true ) ) ;
829+ new ( "StartActivity:StandaloneActivity" , Parent : null , Tags : cancelTags ) ,
830+ new ( "DescribeActivity:" + cancelId , Parent : null , Tags : cancelTags ) ,
831+ new ( "CancelActivity:" + cancelId , Parent : null , Tags : cancelTags ) ,
832+ new ( "StartActivity:StandaloneActivity" , Parent : null , Tags : terminateTags ) ,
833+ new ( "TerminateActivity:" + terminateId , Parent : null , Tags : terminateTags ) ,
834+ ActivityAssertion . NameAndParent ( "CountActivities" , null ) ) ;
828835 }
829836
830837 private static void AssertActivities (
0 commit comments