Skip to content

Commit 03a6298

Browse files
committed
Address merge from main
1 parent 5fef320 commit 03a6298

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

observability-test/spanner.ts

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ describe('EndToEnd', () => {
513513
);
514514

515515
const expectedEventNames = [
516+
'Starting stream',
516517
'Transaction Creation Done',
517518
'Acquiring session',
518519
'Cache hit: has usable session',
@@ -1558,6 +1559,7 @@ SELECT 1p
15581559
'CloudSpanner.Snapshot.begin',
15591560
'CloudSpanner.Transaction.commit',
15601561
'CloudSpanner.Transaction.commit',
1562+
'CloudSpanner.Database.runTransactionAsync',
15611563
];
15621564
assert.deepStrictEqual(
15631565
actualSpanNames,
@@ -1603,22 +1605,20 @@ SELECT 1p
16031605
'Expected that sessionPool.createSessions is the parent to db.batchCreassionSessions'
16041606
);
16051607

1606-
// TODO: Uncomment once we've merged Database.runTransactionAsync tracing.
16071608
// We need to ensure a strict relationship between the spans.
16081609
// |-Database.runTransactionAsync |-------------------------------------|
16091610
// |-Snapshot.run |------------------------|
16101611
// |-Snapshot.runStream |---------------------|
16111612
// |-Transaction.commit |--------|
16121613
// |-Snapshot.begin |------|
16131614
// |-Snapshot.commit |-----|
1614-
/*
16151615
const spanDatabaseRunTransactionAsync = spans[spans.length - 1];
16161616
assert.deepStrictEqual(
16171617
spanDatabaseRunTransactionAsync.name,
16181618
'CloudSpanner.Database.runTransactionAsync',
16191619
`${actualSpanNames}`
16201620
);
1621-
const spanTransactionCommit0 = spans[spans.length - 1];
1621+
const spanTransactionCommit0 = spans[spans.length - 2];
16221622
assert.strictEqual(
16231623
spanTransactionCommit0.name,
16241624
'CloudSpanner.Transaction.commit'
@@ -1643,7 +1643,6 @@ SELECT 1p
16431643
spanDatabaseRunTransactionAsync.spanContext().traceId,
16441644
'Did not expect the same traceId'
16451645
);
1646-
*/
16471646

16481647
// Finally check for the collective expected event names.
16491648
const expectedEventNames = [
@@ -1658,18 +1657,11 @@ SELECT 1p
16581657
'Transaction Creation Done',
16591658
'Starting Commit',
16601659
'Commit Done',
1661-
1662-
// TODO: Uncomment once we've merged Database.runTransactionAsync tracing.
1663-
/*
16641660
'Acquiring session',
16651661
'Waiting for a session to become available',
16661662
'Acquired session',
16671663
'Using Session',
1668-
'Transaction Attempt Failed',
1669-
'Transaction Attempt Aborted',
1670-
'exception',
16711664
'exception',
1672-
*/
16731665
];
16741666
assert.deepStrictEqual(
16751667
actualEventNames,
@@ -2183,6 +2175,7 @@ describe('Traces for ExecuteStream broken stream retries', () => {
21832175
'CloudSpanner.Snapshot.begin',
21842176
'CloudSpanner.Transaction.commit',
21852177
'CloudSpanner.Transaction.commit',
2178+
'CloudSpanner.Database.runTransactionAsync',
21862179
];
21872180
assert.deepStrictEqual(
21882181
actualSpanNames,
@@ -2201,15 +2194,10 @@ describe('Traces for ExecuteStream broken stream retries', () => {
22012194
'Transaction Creation Done',
22022195
'Starting Commit',
22032196
'Commit Done',
2204-
2205-
// TODO: Uncomment once we've merged Database.runTransactionAsync tracing.
2206-
/*
22072197
'Acquiring session',
22082198
'Waiting for a session to become available',
22092199
'Acquired session',
22102200
'Using Session',
2211-
'Transaction Attempt Succeeded',
2212-
*/
22132201
];
22142202
assert.deepStrictEqual(
22152203
actualEventNames,
@@ -2268,6 +2256,7 @@ describe('Traces for ExecuteStream broken stream retries', () => {
22682256
const expectedSpanNames = [
22692257
'CloudSpanner.Database.batchCreateSessions',
22702258
'CloudSpanner.SessionPool.createSessions',
2259+
'CloudSpanner.Database.runTransactionAsync',
22712260
];
22722261
assert.deepStrictEqual(
22732262
actualSpanNames,
@@ -2279,15 +2268,10 @@ describe('Traces for ExecuteStream broken stream retries', () => {
22792268
'Requesting 25 sessions',
22802269
'Creating 25 sessions',
22812270
'Requested for 25 sessions returned 25',
2282-
2283-
// TODO: Uncomment once we've merged Database.runTransactionAsync tracing.
2284-
/*
22852271
'Acquiring session',
22862272
'Waiting for a session to become available',
22872273
'Acquired session',
22882274
'Using Session',
2289-
'Transaction Attempt Succeeded',
2290-
*/
22912275
];
22922276
assert.deepStrictEqual(
22932277
actualEventNames,

0 commit comments

Comments
 (0)