8
8
import static io .airbyte .workers .tracing .TemporalSdkInterceptor .CONNECTION_MANAGER_WORKFLOW_IMPL_RESOURCE_NAME ;
9
9
import static io .airbyte .workers .tracing .TemporalSdkInterceptor .ERROR_MESSAGE_TAG_KEY ;
10
10
import static io .airbyte .workers .tracing .TemporalSdkInterceptor .EXIT_ERROR_MESSAGE ;
11
+ import static io .airbyte .workers .tracing .TemporalSdkInterceptor .SYNC_WORKFLOW_IMPL_RESOURCE_NAME ;
11
12
import static org .junit .jupiter .api .Assertions .assertEquals ;
12
13
import static org .junit .jupiter .api .Assertions .assertFalse ;
13
14
import static org .junit .jupiter .api .Assertions .assertTrue ;
@@ -39,10 +40,15 @@ void testOnTraceComplete() {
39
40
temporalExitMsgOperationNameError .setOperationName (WORKFLOW_TRACE_OPERATION_NAME );
40
41
temporalExitMsgOperationNameError .setTag (ERROR_MESSAGE_TAG_KEY , EXIT_ERROR_MESSAGE );
41
42
42
- final var temporalExitMsgResourceNameError = new DummySpan ();
43
- temporalExitMsgResourceNameError .setError (true );
44
- temporalExitMsgResourceNameError .setResourceName (CONNECTION_MANAGER_WORKFLOW_IMPL_RESOURCE_NAME );
45
- temporalExitMsgResourceNameError .setTag (ERROR_MESSAGE_TAG_KEY , EXIT_ERROR_MESSAGE );
43
+ final var connectionManagerTemporalExitMsgResourceNameError = new DummySpan ();
44
+ connectionManagerTemporalExitMsgResourceNameError .setError (true );
45
+ connectionManagerTemporalExitMsgResourceNameError .setResourceName (CONNECTION_MANAGER_WORKFLOW_IMPL_RESOURCE_NAME );
46
+ connectionManagerTemporalExitMsgResourceNameError .setTag (ERROR_MESSAGE_TAG_KEY , EXIT_ERROR_MESSAGE );
47
+
48
+ final var syncWorkflowTemporalExitMsgResourceNameError = new DummySpan ();
49
+ syncWorkflowTemporalExitMsgResourceNameError .setError (true );
50
+ syncWorkflowTemporalExitMsgResourceNameError .setResourceName (SYNC_WORKFLOW_IMPL_RESOURCE_NAME );
51
+ syncWorkflowTemporalExitMsgResourceNameError .setTag (ERROR_MESSAGE_TAG_KEY , EXIT_ERROR_MESSAGE );
46
52
47
53
final var temporalExitMsgOtherOperationError = new DummySpan ();
48
54
temporalExitMsgOtherOperationError .setError (true );
@@ -55,7 +61,8 @@ void testOnTraceComplete() {
55
61
temporalExitMsgOtherResourceError .setTag (ERROR_MESSAGE_TAG_KEY , EXIT_ERROR_MESSAGE );
56
62
57
63
final var spans = List .of (
58
- simple , noError , otherError , temporalExitMsgOperationNameError , temporalExitMsgResourceNameError , temporalExitMsgOtherOperationError ,
64
+ simple , noError , otherError , temporalExitMsgOperationNameError , connectionManagerTemporalExitMsgResourceNameError ,
65
+ syncWorkflowTemporalExitMsgResourceNameError , temporalExitMsgOtherOperationError ,
59
66
temporalExitMsgOtherResourceError );
60
67
61
68
final var interceptor = new TemporalSdkInterceptor ();
@@ -66,7 +73,8 @@ void testOnTraceComplete() {
66
73
assertFalse (noError .isError ());
67
74
assertTrue (otherError .isError ());
68
75
assertFalse (temporalExitMsgOperationNameError .isError ());
69
- assertFalse (temporalExitMsgResourceNameError .isError ());
76
+ assertFalse (connectionManagerTemporalExitMsgResourceNameError .isError ());
77
+ assertFalse (syncWorkflowTemporalExitMsgResourceNameError .isError ());
70
78
assertTrue (temporalExitMsgOtherOperationError .isError ());
71
79
assertTrue (temporalExitMsgOtherResourceError .isError ());
72
80
}
@@ -91,10 +99,15 @@ void testIsExitTrace() {
91
99
temporalTraceWithErrorAndOperationName .setOperationName (WORKFLOW_TRACE_OPERATION_NAME );
92
100
assertEquals (false , interceptor .isExitTrace (temporalTraceWithErrorAndOperationName ));
93
101
94
- final var temporalTraceWithErrorAndResourceName = new DummySpan ();
95
- temporalTraceWithErrorAndResourceName .setError (true );
96
- temporalTraceWithErrorAndResourceName .setResourceName (CONNECTION_MANAGER_WORKFLOW_IMPL_RESOURCE_NAME );
97
- assertEquals (false , interceptor .isExitTrace (temporalTraceWithErrorAndResourceName ));
102
+ final var temporalTraceWithErrorAndConnectionManagerResourceName = new DummySpan ();
103
+ temporalTraceWithErrorAndConnectionManagerResourceName .setError (true );
104
+ temporalTraceWithErrorAndConnectionManagerResourceName .setResourceName (CONNECTION_MANAGER_WORKFLOW_IMPL_RESOURCE_NAME );
105
+ assertEquals (false , interceptor .isExitTrace (temporalTraceWithErrorAndConnectionManagerResourceName ));
106
+
107
+ final var temporalTraceWithErrorAndSyncWorkflowResourceName = new DummySpan ();
108
+ temporalTraceWithErrorAndSyncWorkflowResourceName .setError (true );
109
+ temporalTraceWithErrorAndSyncWorkflowResourceName .setResourceName (SYNC_WORKFLOW_IMPL_RESOURCE_NAME );
110
+ assertEquals (false , interceptor .isExitTrace (temporalTraceWithErrorAndSyncWorkflowResourceName ));
98
111
99
112
final var temporalTraceWithExitErrorAndOperationName = new DummySpan ();
100
113
temporalTraceWithExitErrorAndOperationName .setError (true );
0 commit comments