Skip to content

Commit

Permalink
chore(testproxy): Address the TestReadModifyWriteRow_Generic_Deadline…
Browse files Browse the repository at this point in the history
…Exceeded conformance test (googleapis#1543)

**Summary**

The conformance test passes a timeout setting into the `createClient` test proxy service. With this change the timeout setting will now be applied to the client and used in the readModifyWriteRow call. This allows the `TestReadModifyWriteRow_Generic_DeadlineExceeded` conformance test to pass because now the timeout is being used for these calls.
  • Loading branch information
danieljbruce authored Dec 13, 2024
1 parent 47689b6 commit 23a2b97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
1 change: 0 additions & 1 deletion testproxy/known_failures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ TestMutateRow_Generic_DeadlineExceeded\|
TestMutateRows_Generic_CloseClient\|
TestMutateRows_Retry_WithRoutingCookie\|
TestMutateRows_Generic_DeadlineExceeded\|
TestReadModifyWriteRow_Generic_DeadlineExceeded\|
TestReadModifyWriteRow_NoRetry_MultiValues\|
TestReadModifyWriteRow_Generic_CloseClient\|
TestReadModifyWriteRow_Generic_MultiStreams\|
Expand Down
18 changes: 5 additions & 13 deletions testproxy/services/create-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ const createClient = ({clientMap}) =>
normalizeCallback(async rawRequest => {
// TODO: Handle refresh periods
const {request} = rawRequest;
const clientConfig = require('../../src/v2/bigtable_client_config.json');
const clientConfig = JSON.parse(
JSON.stringify(require('../../src/v2/bigtable_client_config.json'))
);
const {
callCredential,
clientId,
Expand Down Expand Up @@ -68,18 +70,8 @@ const createClient = ({clientMap}) =>
*/
Object.entries(
clientConfig.interfaces['google.bigtable.v2.Bigtable'].methods
).forEach(([k, v]) => {
if (k === 'ReadRows') {
/*
TODO: In the future we should apply this for all methods, but right
now doing so results in regressions in the TestSampleRowKeys_Generic_MultiStreams
and TestSampleRowKeys_Generic_CloseClient conformance tests that need
to be addressed.
*/
v.timeout_millis = durationToMilliseconds(
request.perOperationTimeout
);
}
).forEach(([, v]) => {
v.timeout_millis = durationToMilliseconds(request.perOperationTimeout);
});
}
const bigtable = new Bigtable({
Expand Down

0 comments on commit 23a2b97

Please sign in to comment.