We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0672b4d commit 295edf4Copy full SHA for 295edf4
integration-tests/profiler/codehotspots.js
@@ -34,7 +34,7 @@ function runBusySpans () {
34
for (let i = 0; i < 3; ++i) {
35
const z = i
36
tracer.trace('y' + i, (_, done2) => {
37
- setTimeout(() => {
+ const busyWork = () => {
38
busyLoop()
39
done2()
40
if (z === 2) {
@@ -43,7 +43,17 @@ function runBusySpans () {
43
}
44
done()
45
46
- }, 0)
+ }
47
+ if (i === 1) {
48
+ // Exercise sample context propagation through a promise
49
+ const p = new Promise((resolve) => {
50
+ setTimeout(resolve, 0)
51
+ })
52
+ p.then(busyWork)
53
+ } else {
54
+ // Exercise sample context propagation through a timeout
55
+ setTimeout(busyWork, 0)
56
57
})
58
59
0 commit comments