Skip to content

Commit ea15c1a

Browse files
committed
even more unflaking??
1 parent eb67434 commit ea15c1a

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 numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as Sentry from '@sentry/browser';
2-
import { startSpanManual } from '@sentry/browser';
32

43
window.Sentry = Sentry;
54

@@ -8,13 +7,18 @@ Sentry.init({
87
integrations: [
98
Sentry.browserTracingIntegration({
109
// To avoid having this test run for 15s
11-
childSpanTimeout: 5000,
10+
childSpanTimeout: 4000,
1211
}),
1312
],
1413
defaultIntegrations: false,
1514
tracesSampleRate: 1,
1615
});
1716

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+
}

0 commit comments

Comments
 (0)