@@ -27,9 +27,6 @@ test('undici instrumentation', async function (t) {
27
27
const agent = helper . loadMockedAgent ( )
28
28
agent . config . distributed_tracing . enabled = false
29
29
agent . config . cross_application_tracer . enabled = false
30
- agent . config . feature_flag = {
31
- undici_async_tracking : true
32
- }
33
30
const shim = new TransactionShim ( agent , 'undici' )
34
31
const loggerMock = require ( '../mocks/logger' ) ( sandbox )
35
32
const undiciInstrumentation = proxyquire ( '../../../lib/instrumentation/undici' , {
@@ -43,7 +40,6 @@ test('undici instrumentation', async function (t) {
43
40
sandbox . resetHistory ( )
44
41
agent . config . distributed_tracing . enabled = false
45
42
agent . config . cross_application_tracer . enabled = false
46
- agent . config . feature_flag . undici_async_tracking = true
47
43
helper . unloadAgent ( agent )
48
44
} )
49
45
@@ -130,84 +126,6 @@ test('undici instrumentation', async function (t) {
130
126
}
131
127
)
132
128
133
- await t . test (
134
- 'should get the parent segment executionAsyncResource when it already exists' ,
135
- function ( t , end ) {
136
- helper . runInTransaction ( agent , function ( tx ) {
137
- const addHeader = sandbox . stub ( )
138
- const request = { origin : HOST , path : '/foo-2' , addHeader }
139
- channels . create . publish ( { request } )
140
- const segment = tx . trace . add ( 'another segment' )
141
- segment . start ( )
142
- shim . setActiveSegment ( segment )
143
- const request2 = { path : '/path' , addHeader, origin : HOST }
144
- channels . create . publish ( { request : request2 } )
145
- assert . equal (
146
- request [ symbols . parentSegment ] . id ,
147
- request2 [ symbols . parentSegment ] . id ,
148
- 'parent segment should be same'
149
- )
150
- assert . equal (
151
- request [ symbols . transaction ] . id ,
152
- request2 [ symbols . transaction ] . id ,
153
- 'tx should be same'
154
- )
155
- tx . end ( )
156
- end ( )
157
- } )
158
- }
159
- )
160
-
161
- await t . test (
162
- 'should get diff parent segment across diff async execution contexts' ,
163
- function ( t , end ) {
164
- helper . runInTransaction ( agent , function ( tx ) {
165
- const request = { origin : HOST , path : '/request1' , addHeader : sandbox . stub ( ) }
166
- channels . create . publish ( { request } )
167
- Promise . resolve ( 'test' ) . then ( ( ) => {
168
- const segment = tx . trace . add ( 'another segment' )
169
- segment . start ( )
170
- shim . setActiveSegment ( segment )
171
- const request2 = { path : '/request2' , addHeader : sandbox . stub ( ) , origin : HOST }
172
- channels . create . publish ( { request : request2 } )
173
- assert . notEqual ( request [ symbols . parentSegment ] , request2 [ symbols . parentSegment ] )
174
- assert . equal ( request [ symbols . transaction ] , request2 [ symbols . transaction ] )
175
- tx . end ( )
176
- end ( )
177
- } )
178
- } )
179
- }
180
- )
181
-
182
- await t . test (
183
- 'should get the parent segment shim when `undici_async_tracking` is false' ,
184
- function ( t , end ) {
185
- agent . config . feature_flag . undici_async_tracking = false
186
- helper . runInTransaction ( agent , function ( tx ) {
187
- const addHeader = sandbox . stub ( )
188
- const request = { path : '/foo-2' , addHeader, origin : HOST }
189
- channels . create . publish ( { request } )
190
- const segment = tx . trace . add ( 'another segment' )
191
- segment . start ( )
192
- shim . setActiveSegment ( segment )
193
- const request2 = { path : '/path' , addHeader, origin : HOST }
194
- channels . create . publish ( { request : request2 } )
195
- assert . notEqual (
196
- request [ symbols . parentSegment ] . name ,
197
- request2 [ symbols . parentSegment ] . name ,
198
- 'parent segment should not be same'
199
- )
200
- assert . equal (
201
- request [ symbols . transaction ] . id ,
202
- request2 [ symbols . transaction ] . id ,
203
- 'tx should be the same'
204
- )
205
- tx . end ( )
206
- end ( )
207
- } )
208
- }
209
- )
210
-
211
129
await t . test (
212
130
'should name segment with appropriate attrs based on request.path' ,
213
131
function ( t , end ) {
0 commit comments