From 76ac50c903f282d8c716f74bd534d60443cb3d6f Mon Sep 17 00:00:00 2001 From: feywind <57276408+feywind@users.noreply.github.com> Date: Tue, 16 Sep 2025 15:44:07 -0400 Subject: [PATCH 1/2] tests: fix TestMutateRow_Generic_DeadlineExceeded --- testproxy/known_failures.txt | 1 - testproxy/services/mutate-row.js | 24 +++++++++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/testproxy/known_failures.txt b/testproxy/known_failures.txt index f8210a570..b68c40c3b 100644 --- a/testproxy/known_failures.txt +++ b/testproxy/known_failures.txt @@ -1,4 +1,3 @@ -TestMutateRow_Generic_DeadlineExceeded\| TestMutateRow_Generic_CloseClient\| TestMutateRows_Retry_WithRoutingCookie\| TestReadRow_Generic_DeadlineExceeded\| diff --git a/testproxy/services/mutate-row.js b/testproxy/services/mutate-row.js index 88c344e88..b8d8cd412 100644 --- a/testproxy/services/mutate-row.js +++ b/testproxy/services/mutate-row.js @@ -28,16 +28,22 @@ const mutateRow = ({clientMap}) => const appProfileId = clientMap.get(clientId).appProfileId; const client = clientMap.get(clientId)[v2]; - await client.mutateRow({ - appProfileId, - mutations, - tableName, - rowKey, - }); + try { + await client.mutateRow({ + appProfileId, + mutations, + tableName, + rowKey, + }); - return { - status: {code: grpc.status.OK, details: []}, - }; + return { + status: {code: grpc.status.OK, details: []}, + }; + } catch (e) { + return { + status: e, + }; + } }); module.exports = mutateRow; From f18d7b2ce43359cad3a2c50cce77f3fc810361db Mon Sep 17 00:00:00 2001 From: feywind <57276408+feywind@users.noreply.github.com> Date: Tue, 16 Sep 2025 17:31:44 -0400 Subject: [PATCH 2/2] tests: fix TestReadRow_Generic_DeadlineExceeded --- src/row.ts | 5 +++-- src/utils/createReadStreamInternal.ts | 13 +++++++++++++ testproxy/known_failures.txt | 1 - testproxy/services/read-row.js | 19 +++++++++++++------ 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/row.ts b/src/row.ts index 94155211d..b97177110 100644 --- a/src/row.ts +++ b/src/row.ts @@ -30,7 +30,7 @@ import {CallOptions} from 'google-gax'; import {ServiceError} from 'google-gax'; import {google} from '../protos/protos'; import {RowDataUtils, RowProperties} from './row-data-utils'; -import {TabularApiSurface} from './tabular-api-surface'; +import {GetRowsOptions, TabularApiSurface} from './tabular-api-surface'; import {getRowsInternal} from './utils/getRowsInternal'; import { MethodName, @@ -667,9 +667,10 @@ export class Row { filter = arrify(filter).concat(options.filter); } - const getRowsOptions = Object.assign({}, options, { + const getRowsOptions: GetRowsOptions = Object.assign({}, options, { keys: [this.id], filter, + limit: 1, }); const metricsCollector = diff --git a/src/utils/createReadStreamInternal.ts b/src/utils/createReadStreamInternal.ts index 15f3b168a..59026fbcd 100644 --- a/src/utils/createReadStreamInternal.ts +++ b/src/utils/createReadStreamInternal.ts @@ -428,6 +428,19 @@ export function createReadStreamInternal( rowStreamPipe(rowStream, userStream); }; + // If the timeout is exceeded for the whole operation, bail with + // an error as the conformance test requires. + if (timeout) { + const deadlineTimer = setTimeout(() => { + const err = new Error(`Total timeout of ${timeout}ms exceeded.`); + (err as unknown as grpc.StatusObject).code = + grpc.status.DEADLINE_EXCEEDED; + userStream.destroy(err); + }, timeout); + + userStream.on('close', () => clearTimeout(deadlineTimer)); + } + makeNewRequest(); return userStream; } diff --git a/testproxy/known_failures.txt b/testproxy/known_failures.txt index b68c40c3b..0f584e3e0 100644 --- a/testproxy/known_failures.txt +++ b/testproxy/known_failures.txt @@ -1,6 +1,5 @@ TestMutateRow_Generic_CloseClient\| TestMutateRows_Retry_WithRoutingCookie\| -TestReadRow_Generic_DeadlineExceeded\| TestReadRow_Retry_WithRoutingCookie\| TestReadRow_Retry_WithRetryInfo\| TestReadRows_ReverseScans_FeatureFlag_Enabled\| diff --git a/testproxy/services/read-row.js b/testproxy/services/read-row.js index 7ea53cb22..b5290291f 100644 --- a/testproxy/services/read-row.js +++ b/testproxy/services/read-row.js @@ -26,13 +26,20 @@ const readRow = ({clientMap}) => const bigtable = clientMap.get(clientId); const table = getTableInfo(bigtable, tableName); const row = table.row(rowKey); - const res = await row.get(columns); - const firstRow = getRowResponse(res[0]); - return { - status: {code: grpc.status.OK, details: []}, - row: firstRow, - }; + try { + const res = await row.get(columns); + const firstRow = getRowResponse(res[0]); + + return { + status: {code: grpc.status.OK, details: []}, + row: firstRow, + }; + } catch (e) { + return { + status: e, + }; + } }); module.exports = readRow;