From 5219f0c7d65b6972f6f001c9996993ad1a635aae Mon Sep 17 00:00:00 2001 From: Summer Ji Date: Mon, 2 May 2022 09:23:22 -0700 Subject: [PATCH 1/2] fix: flaky system test --- system-test/speech_system_test.js | 4 ++-- system-test/speech_system_test_v1.js | 4 ++-- system-test/speech_system_test_v1p1beta1.js | 4 ++-- system-test/speech_typescript_system_test.ts | 6 +++--- system-test/speech_typescript_system_test_v1.ts | 6 +++--- system-test/speech_typescript_system_test_v1p1beta1.ts | 6 +++--- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/system-test/speech_system_test.js b/system-test/speech_system_test.js index 4b980829..97baa848 100644 --- a/system-test/speech_system_test.js +++ b/system-test/speech_system_test.js @@ -95,9 +95,9 @@ describe('SpeechClient system test default', () => { const stream = client.streamingRecognize(request); let gotResponse = false; stream.on('data', response => { - assert.strictEqual( + assert.match( response.results[0].alternatives[0].transcript, - 'test of streaming recognized call' + /test of streaming.*call/ ); gotResponse = true; }); diff --git a/system-test/speech_system_test_v1.js b/system-test/speech_system_test_v1.js index ba5c207a..778a08bf 100644 --- a/system-test/speech_system_test_v1.js +++ b/system-test/speech_system_test_v1.js @@ -95,9 +95,9 @@ describe('SpeechClient system test v1', () => { const stream = client.streamingRecognize(request); let gotResponse = false; stream.on('data', response => { - assert.strictEqual( + assert.match( response.results[0].alternatives[0].transcript, - 'test of streaming recognized call' + /test of streaming.*call/ ); gotResponse = true; }); diff --git a/system-test/speech_system_test_v1p1beta1.js b/system-test/speech_system_test_v1p1beta1.js index 8f5826cf..c1fd231a 100644 --- a/system-test/speech_system_test_v1p1beta1.js +++ b/system-test/speech_system_test_v1p1beta1.js @@ -95,9 +95,9 @@ describe('SpeechClient system test v1p1beta1', () => { const stream = client.streamingRecognize(request); let gotResponse = false; stream.on('data', response => { - assert.strictEqual( + assert.match( response.results[0].alternatives[0].transcript, - 'test of streaming recognized call' + /test of streaming.*call/ ); gotResponse = true; }); diff --git a/system-test/speech_typescript_system_test.ts b/system-test/speech_typescript_system_test.ts index a5674d9e..04a1c229 100644 --- a/system-test/speech_typescript_system_test.ts +++ b/system-test/speech_typescript_system_test.ts @@ -107,9 +107,9 @@ describe('SpeechClient TypeScript system test default', () => { stream.on( 'data', (response: google.cloud.speech.v1.IStreamingRecognizeResponse) => { - assert.strictEqual( - response.results![0].alternatives![0].transcript, - 'test of streaming recognized call' + assert.doesNotMatch( + response.results![0].alternatives![0].transcript ?? '', + /test of streaming.*call/ ); gotResponse = true; } diff --git a/system-test/speech_typescript_system_test_v1.ts b/system-test/speech_typescript_system_test_v1.ts index 2227be85..27316b60 100644 --- a/system-test/speech_typescript_system_test_v1.ts +++ b/system-test/speech_typescript_system_test_v1.ts @@ -107,9 +107,9 @@ describe('SpeechClient TypeScript system test v1', () => { stream.on( 'data', (response: google.cloud.speech.v1.IStreamingRecognizeResponse) => { - assert.strictEqual( - response.results![0].alternatives![0].transcript, - 'test of streaming recognized call' + assert.doesNotMatch( + response.results![0].alternatives![0].transcript ?? '', + /test of streaming.*call/ ); gotResponse = true; } diff --git a/system-test/speech_typescript_system_test_v1p1beta1.ts b/system-test/speech_typescript_system_test_v1p1beta1.ts index 280b2e82..2e3244b3 100644 --- a/system-test/speech_typescript_system_test_v1p1beta1.ts +++ b/system-test/speech_typescript_system_test_v1p1beta1.ts @@ -107,9 +107,9 @@ describe('SpeechClient TypeScript system test v1p1beta1', () => { stream.on( 'data', (response: google.cloud.speech.v1p1beta1.IStreamingRecognizeResponse) => { - assert.strictEqual( - response.results![0].alternatives![0].transcript, - 'test of streaming recognized call' + assert.doesNotMatch( + response.results![0].alternatives![0].transcript ?? '', + /test of streaming.*call/ ); gotResponse = true; } From 6fbd4ed0d16b0bab9be374b7631451ac345b2a5d Mon Sep 17 00:00:00 2001 From: Summer Ji Date: Mon, 2 May 2022 09:27:04 -0700 Subject: [PATCH 2/2] fix typo --- system-test/speech_typescript_system_test.ts | 2 +- system-test/speech_typescript_system_test_v1.ts | 2 +- system-test/speech_typescript_system_test_v1p1beta1.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/system-test/speech_typescript_system_test.ts b/system-test/speech_typescript_system_test.ts index 04a1c229..6d701c78 100644 --- a/system-test/speech_typescript_system_test.ts +++ b/system-test/speech_typescript_system_test.ts @@ -107,7 +107,7 @@ describe('SpeechClient TypeScript system test default', () => { stream.on( 'data', (response: google.cloud.speech.v1.IStreamingRecognizeResponse) => { - assert.doesNotMatch( + assert.match( response.results![0].alternatives![0].transcript ?? '', /test of streaming.*call/ ); diff --git a/system-test/speech_typescript_system_test_v1.ts b/system-test/speech_typescript_system_test_v1.ts index 27316b60..d3f63e8c 100644 --- a/system-test/speech_typescript_system_test_v1.ts +++ b/system-test/speech_typescript_system_test_v1.ts @@ -107,7 +107,7 @@ describe('SpeechClient TypeScript system test v1', () => { stream.on( 'data', (response: google.cloud.speech.v1.IStreamingRecognizeResponse) => { - assert.doesNotMatch( + assert.match( response.results![0].alternatives![0].transcript ?? '', /test of streaming.*call/ ); diff --git a/system-test/speech_typescript_system_test_v1p1beta1.ts b/system-test/speech_typescript_system_test_v1p1beta1.ts index 2e3244b3..31ef1868 100644 --- a/system-test/speech_typescript_system_test_v1p1beta1.ts +++ b/system-test/speech_typescript_system_test_v1p1beta1.ts @@ -107,7 +107,7 @@ describe('SpeechClient TypeScript system test v1p1beta1', () => { stream.on( 'data', (response: google.cloud.speech.v1p1beta1.IStreamingRecognizeResponse) => { - assert.doesNotMatch( + assert.match( response.results![0].alternatives![0].transcript ?? '', /test of streaming.*call/ );