Skip to content

Commit bdd64ec

Browse files
tmshortclaude
andcommitted
🐛 Clean output directory before profiling runs
Previously, run-profiled-test.sh would create the output directory with mkdir -p but not clean up existing files. This caused old profile files to remain and potentially confuse analysis when mixing single-component and multi-component data. Now the script: - Warns if the output directory already exists - Removes the entire directory to start fresh - Creates a clean directory for the new profiling run This ensures each test run has clean, isolated data. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e2e7cd3 commit bdd64ec

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

hack/tools/memory-profiling/run-profiled-test.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ log_warn() {
4747
echo -e "${YELLOW}[WARN]${NC} $*"
4848
}
4949

50-
# Create output directory
50+
# Create output directory (clean up if it exists)
51+
if [ -d "${OUTPUT_DIR}" ]; then
52+
log_warn "Output directory already exists: ${OUTPUT_DIR}"
53+
log_warn "Removing old profiles to start fresh..."
54+
rm -rf "${OUTPUT_DIR}"
55+
fi
5156
mkdir -p "${OUTPUT_DIR}"
5257

5358
# Update OUTPUT_DIR_ABS now that directory exists

0 commit comments

Comments
 (0)