test(logging): re-enable ITSinkTest and scope sink cleanup to test prefix#13367
Draft
lqiu96 wants to merge 5 commits into
Draft
test(logging): re-enable ITSinkTest and scope sink cleanup to test prefix#13367lqiu96 wants to merge 5 commits into
lqiu96 wants to merge 5 commits into
Conversation
…efix Fixes b/482174880 (GitHub Issue #11906) by ensuring setUp() only cleans up leaked test sinks matching TEST_SINK_PREFIX, avoiding PERMISSION_DENIED errors on immutable built-in system sinks (_Required, _Default). Also wraps test verification logic in try...finally blocks for robust self-cleanup. BUG=b/482174880 TAG=agy CONV=d4a74f94-579a-4c3f-96c3-f90fcbc6c699
Contributor
There was a problem hiding this comment.
Code Review
This pull request re-enables the testCreateGetUpdateAndDeleteSink integration test and wraps its assertions in a try-finally block to ensure proper cleanup of created sinks. It also introduces a cleanup filter in setUp() to only delete sinks starting with a specific prefix. However, the reviewer noted that the newly introduced TEST_SINK_PREFIX ("test-") does not match the actual prefix prepended by formatForTest ("gcloud-test-"), which will cause the cleanup process to skip the leaked sinks. The reviewer suggests using the inherited PREFIX constant instead.
Replaces static import of RemoteLoggingHelper.formatForTest with a class-local helper method that automatically prepends TEST_SINK_PREFIX, ensuring a standardized log entry and test sink prefix across all test cases within ITSinkTest. BUG=b/482174880 TAG=agy CONV=d4a74f94-579a-4c3f-96c3-f90fcbc6c699
…lper Embeds TEST_SINK_PREFIX directly within RemoteLoggingHelper.formatForTest(), ensuring all client test cases across the entire test suite consistently receive standardized prefix formatting without requiring class-local wrappers or repetitive literal string prefixes. BUG=b/482174880 TAG=agy CONV=d4a74f94-579a-4c3f-96c3-f90fcbc6c699
…lper Exposes TEST_SINK_PREFIX as public constant in RemoteLoggingHelper and statically imports it directly into ITSinkTest, removing duplicate local constant declarations. BUG=b/482174880 TAG=agy CONV=d4a74f94-579a-4c3f-96c3-f90fcbc6c699
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11906 (b/482174880)
Ensure setUp() only cleans up leaked test sinks matching TEST_SINK_PREFIX, avoiding PERMISSION_DENIED errors on immutable built-in system sinks (_Required, _Default). Also wraps test verification logic in try...finally blocks for robust self-cleanup.