Skip to content

Commit

Permalink
fix(document-load): compatibility issue with @opentelemetry/sdk-trace…
Browse files Browse the repository at this point in the history
…-web@1.15.0 (#1565)
  • Loading branch information
chigia001 authored Jul 11, 2023
1 parent a18b074 commit 774d254
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"@opentelemetry/core": "^1.8.0",
"@opentelemetry/instrumentation": "^0.40.0",
"@opentelemetry/sdk-trace-base": "^1.0.0",
"@opentelemetry/sdk-trace-web": "^1.8.0",
"@opentelemetry/sdk-trace-web": "^1.15.0",
"@opentelemetry/semantic-conventions": "^1.0.0",
"tslib": "^2.3.1"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,10 @@ function ensureNetworkEventsExists(events: TimedEvent[]) {
assert.strictEqual(events[1].name, PTN.DOMAIN_LOOKUP_START);
assert.strictEqual(events[2].name, PTN.DOMAIN_LOOKUP_END);
assert.strictEqual(events[3].name, PTN.CONNECT_START);
assert.strictEqual(events[4].name, PTN.SECURE_CONNECTION_START);
assert.strictEqual(events[5].name, PTN.CONNECT_END);
assert.strictEqual(events[6].name, PTN.REQUEST_START);
assert.strictEqual(events[7].name, PTN.RESPONSE_START);
assert.strictEqual(events[8].name, PTN.RESPONSE_END);
assert.strictEqual(events[4].name, PTN.CONNECT_END);
assert.strictEqual(events[5].name, PTN.REQUEST_START);
assert.strictEqual(events[6].name, PTN.RESPONSE_START);
assert.strictEqual(events[7].name, PTN.RESPONSE_END);
}

describe('DocumentLoad Instrumentation', () => {
Expand Down Expand Up @@ -370,7 +369,7 @@ describe('DocumentLoad Instrumentation', () => {
assert.strictEqual(fsEvents[7].name, PTN.LOAD_EVENT_START);
assert.strictEqual(fsEvents[8].name, PTN.LOAD_EVENT_END);

assert.strictEqual(rsEvents.length, 9);
assert.strictEqual(rsEvents.length, 8);
assert.strictEqual(fsEvents.length, 11);
assert.strictEqual(exporter.getFinishedSpans().length, 2);
done();
Expand Down Expand Up @@ -486,15 +485,7 @@ describe('DocumentLoad Instrumentation', () => {
'http://localhost:8090/bundle.js'
);

assert.strictEqual(srEvents1[0].name, PTN.FETCH_START);
assert.strictEqual(srEvents1[1].name, PTN.DOMAIN_LOOKUP_START);
assert.strictEqual(srEvents1[2].name, PTN.DOMAIN_LOOKUP_END);
assert.strictEqual(srEvents1[3].name, PTN.CONNECT_START);
assert.strictEqual(srEvents1[4].name, PTN.SECURE_CONNECTION_START);
assert.strictEqual(srEvents1[5].name, PTN.CONNECT_END);
assert.strictEqual(srEvents1[6].name, PTN.REQUEST_START);
assert.strictEqual(srEvents1[7].name, PTN.RESPONSE_START);
assert.strictEqual(srEvents1[8].name, PTN.RESPONSE_END);
ensureNetworkEventsExists(srEvents1);

assert.strictEqual(exporter.getFinishedSpans().length, 3);
done();
Expand Down Expand Up @@ -570,7 +561,7 @@ describe('DocumentLoad Instrumentation', () => {
assert.strictEqual(rsEvents[7].name, PTN.LOAD_EVENT_START);
assert.strictEqual(rsEvents[8].name, PTN.LOAD_EVENT_END);

assert.strictEqual(fsEvents.length, 9);
assert.strictEqual(fsEvents.length, 8);
assert.strictEqual(rsEvents.length, 9);
assert.strictEqual(exporter.getFinishedSpans().length, 2);
done();
Expand Down

0 comments on commit 774d254

Please sign in to comment.