fix(livestream): stop all channels before pool update to avoid FAILED_PRECONDITION#4312
fix(livestream): stop all channels before pool update to avoid FAILED_PRECONDITION#4312angelcaamal wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request modifies the test cleanup logic in livestream.test.js to attempt stopping all channels before checking their age. The review feedback suggests filtering channels by a name prefix to prevent disrupting other test runs and refining the error handling to check for specific error codes when a channel fails to stop.
| for (const channel of channels) { | ||
| if (channel.createTime.seconds < DATE_NOW_SEC - THREE_HOURS_IN_SEC) { | ||
| const isTestChannel = channel.name.includes( | ||
| 'nodejs-test-livestream-channel' |
There was a problem hiding this comment.
Out of curiosity, why are these channels being filtered, and is this defined anywhere else?
Maybe it is worth to store it in a const or a comment to provide context 🤔
There was a problem hiding this comment.
@amcolin Great point! The old code was fetching all channels. I added this filter to make sure we only modify the channels created by this specific test, just to be safe and avoid messing with other people's channels
Description
Fixes Internal: b/511248282
Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.
Checklist
npm test(see Testing)npm run lint(see Style)GoogleCloudPlatform/nodejs-docs-samples. Not a fork.