@@ -1190,7 +1190,10 @@ describe('Bigtable/Table', () => {
11901190 . on ( 'data' , done ) ;
11911191 } ) ;
11921192 } ) ;
1193- it ( 'Should respect the timeout parameter passed in for UNAVAILABLE error' , done => {
1193+
1194+ // Skip: This test currently doesn't make sense after conformance test
1195+ // changes. The error will always be DEADLINE_EXCEEDED, not UNAVAILABLE.
1196+ it . skip ( 'Should respect the timeout parameter passed in for UNAVAILABLE error' , done => {
11941197 // The timeout is 2 seconds, but the error is received after 3 seconds
11951198 // so the client doesn't retry because more than 2 seconds have elapsed.
11961199 const requestSpy = ( table . bigtable . request = sinon . spy ( ( ) => {
@@ -1216,6 +1219,7 @@ describe('Bigtable/Table', () => {
12161219 it ( 'Should respect the timeout parameter passed in for DEADLINE_EXCEEDED error' , done => {
12171220 // The timeout is 2 seconds, but the error is received after 3 seconds
12181221 // so the client doesn't retry because more than 2 seconds have elapsed.
1222+ let timeoutReceived = false ;
12191223 const requestSpy = ( table . bigtable . request = sinon . spy ( ( ) => {
12201224 const stream = new PassThrough ( {
12211225 objectMode : true ,
@@ -1230,10 +1234,16 @@ describe('Bigtable/Table', () => {
12301234 } ) ) ;
12311235 const stream = table . createReadStream ( { gaxOptions : { timeout : 2000 } } ) ;
12321236 stream . on ( 'error' , ( error : ServiceError ) => {
1233- assert . strictEqual ( error . code , 4 ) ;
1234- assert . strictEqual ( error . message , 'retry me!' ) ;
1235- assert . strictEqual ( requestSpy . callCount , 1 ) ; // Ensures the client has not retried.
1236- done ( ) ;
1237+ if ( ! timeoutReceived ) {
1238+ assert . strictEqual ( error . code , 4 ) ;
1239+ assert . strictEqual (
1240+ error . message ,
1241+ 'Total timeout of 2000ms exceeded.' ,
1242+ ) ;
1243+ assert . strictEqual ( requestSpy . callCount , 1 ) ; // Ensures the client has not retried.
1244+ done ( ) ;
1245+ }
1246+ timeoutReceived = true ;
12371247 } ) ;
12381248 } ) ;
12391249 describe ( 'retries' , ( ) => {
0 commit comments