Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
fix: flaky system test (#882)
Browse files Browse the repository at this point in the history
  • Loading branch information
summer-ji-eng authored May 2, 2022
1 parent 1a0f0ea commit e837b64
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions system-test/speech_system_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down
4 changes: 2 additions & 2 deletions system-test/speech_system_test_v1.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down
4 changes: 2 additions & 2 deletions system-test/speech_system_test_v1p1beta1.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down
6 changes: 3 additions & 3 deletions system-test/speech_typescript_system_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.match(
response.results![0].alternatives![0].transcript ?? '',
/test of streaming.*call/
);
gotResponse = true;
}
Expand Down
6 changes: 3 additions & 3 deletions system-test/speech_typescript_system_test_v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.match(
response.results![0].alternatives![0].transcript ?? '',
/test of streaming.*call/
);
gotResponse = true;
}
Expand Down
6 changes: 3 additions & 3 deletions system-test/speech_typescript_system_test_v1p1beta1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.match(
response.results![0].alternatives![0].transcript ?? '',
/test of streaming.*call/
);
gotResponse = true;
}
Expand Down

0 comments on commit e837b64

Please sign in to comment.