RUM-13679: Delete Perfetto result file after batch write#3485
Closed
ambushwork wants to merge 9 commits into
Closed
RUM-13679: Delete Perfetto result file after batch write#3485ambushwork wants to merge 9 commits into
ambushwork wants to merge 9 commits into
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…DataWriter Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eletion
- safeDelete now logs WARN when File.delete() returns false (matching AnrProfilingTriggerRegistrar pattern)
- LOG_FILE_DELETE_FAILED updated to include path placeholder (%s)
- Three pre-existing tests assert file is deleted after write()
- M delete result file W write {events present} adds write interaction assertion
- M skip writing W write {can't read perfetto File} uses TempDir non-existent path and expects WARN log
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…cleanup always runs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…assertion Update LOG_CONTINUOUS_PROFILING_DROPPED_NO_RUM_EVENTS to say "not uploaded" instead of "dropped", and add a log-message verification to the empty-events test; also remove dead mockSdkCore.getFeature(PROFILING_FEATURE_NAME) setup. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
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.
Summary
ProfilingDataWriter.write()now deletes the Perfetto result file (*.perfetto-stack-sample) after every call — insidewriteScopeon the I/O thread after the batch write attempt, and as an early guard when the profiling feature scope is null. This covers all exit paths: successful write, empty-events skip, and feature-uninitialized.ProfilingFeature.tryWriteProfilingEvent()CONTINUOUS branch no longer returns early when there are no pending RUM events — it always callsdataWriter.write()so the writer-owned cleanup always runs.safeDeletelogs WARN (with file path) whenFile.delete()returns false or throws, matching the pattern inAnrProfilingTriggerRegistrar.Test Plan
ProfilingDataWriterTesttests assert file is deleted on all paths (feature null, events present, no events)ProfilingDataWriterTesttests updated to also assertfile.exists() == falseProfilingFeatureTest: updated no-events CONTINUOUS test now verifieswrite()is always called with empty lists + user log fires./gradlew :features:dd-sdk-android-profiling:testDebugUnitTest./gradlew :features:dd-sdk-android-profiling:detekt🤖 Generated with Claude Code