Skip to content

Commit

Permalink
Capture memory leak failures during tests
Browse files Browse the repository at this point in the history
Tests will automatically save memory dumps when out of memory issues
occur in java test cases. Updated CI to also pick these up for
troubleshooting as needed.

Signed-off-by: Peter Nied <[email protected]>
  • Loading branch information
peternied committed Dec 9, 2024
1 parent fc62f57 commit 35c77f9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,24 @@ jobs:
env:
OS_MIGRATIONS_GRADLE_SCAN_TOS_AGREE_AND_ENABLED: ''

- name: Detect Memory Dumps
if: failure()
run: |
if find . -type f -name "*.hprof" | grep -q '.'; then
echo "::group::Memory Dumps Detected"
echo "::warning::Memory dumps were found and uploaded as artifacts. Review these files to diagnose OOM issues."
echo "To download and inspect these files, navigate to 'Actions' -> 'Artifacts'."
echo "::endgroup::"
fi
- name: Upload memory dump
if: failure()
uses: actions/upload-artifact@v4
with:
if-no-files-found: ignore
name: memory-dumps
path: ./**/*.hprof

- uses: actions/upload-artifact@v4
if: always()
with:
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ subprojects {
systemProperty 'junit.jupiter.execution.parallel.enabled', 'false'
systemProperty 'log4j2.contextSelector', 'org.apache.logging.log4j.core.selector.BasicContextSelector'
// Verify assertions in tests
jvmArgs '-ea'
jvmArgs = ['-ea', '-XX:+HeapDumpOnOutOfMemoryError']
jacoco.enabled = true
}

Expand Down

0 comments on commit 35c77f9

Please sign in to comment.