File tree 1 file changed +9
-5
lines changed
dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/pageloadWithChildSpanTimeout
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 1
1
import * as Sentry from '@sentry/browser' ;
2
- import { startSpanManual } from '@sentry/browser' ;
3
2
4
3
window . Sentry = Sentry ;
5
4
@@ -8,13 +7,18 @@ Sentry.init({
8
7
integrations : [
9
8
Sentry . browserTracingIntegration ( {
10
9
// To avoid having this test run for 15s
11
- childSpanTimeout : 5000 ,
10
+ childSpanTimeout : 4000 ,
12
11
} ) ,
13
12
] ,
14
13
defaultIntegrations : false ,
15
14
tracesSampleRate : 1 ,
16
15
} ) ;
17
16
18
- setTimeout ( ( ) => {
19
- startSpanManual ( { name : 'pageload-child-span' } , ( ) => { } ) ;
20
- } , 200 ) ;
17
+ const activeSpan = Sentry . getActiveSpan ( ) ;
18
+ if ( activeSpan ) {
19
+ Sentry . startInactiveSpan ( { name : 'pageload-child-span' } ) ;
20
+ } else {
21
+ setTimeout ( ( ) => {
22
+ Sentry . startInactiveSpan ( { name : 'pageload-child-span' } ) ;
23
+ } , 200 ) ;
24
+ }
You can’t perform that action at this time.
0 commit comments