3131 # This value should be greater than the time taken for the longest image pull.
3232 TESTCONTAINERS_PULL_PAUSE_TIMEOUT : 600
3333 TEST_REPORT_RETENTION_DAYS : 5
34+ HEAP_DUMP_RETENTION_DAYS : 14
3435 # used by actions/cache to retry the download after this time: https://github.com/actions/cache/blob/main/workarounds.md#cache-segment-restore-timeout
3536 SEGMENT_DOWNLOAD_TIMEOUT_MINS : 5
3637
@@ -153,6 +154,8 @@ jobs:
153154 test-jdbc-compatibility :
154155 runs-on : ubuntu-latest
155156 timeout-minutes : 30
157+ env :
158+ SECRETS_PRESENT : ${{ secrets.SECRETS_PRESENT }}
156159 steps :
157160 - uses : actions/checkout@v3
158161 with :
@@ -193,6 +196,15 @@ jobs:
193196 path : |
194197 **/surefire-reports/TEST-*.xml
195198 retention-days : ${{ env.TEST_REPORT_RETENTION_DAYS }}
199+ - name : Upload heap dump
200+ uses : actions/upload-artifact@v3
201+ if : failure() && env.SECRETS_PRESENT == '' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
202+ with :
203+ name : heap dump ${{ github.job }}
204+ if-no-files-found : ' ignore'
205+ path : |
206+ **/*.hprof
207+ retention-days : ${{ env.HEAP_DUMP_RETENTION_DAYS }}
196208 - name : Clean local Maven repo
197209 # Avoid creating a cache entry because this job doesn't download all dependencies
198210 if : steps.cache.outputs.cache-hit != 'true'
@@ -207,6 +219,8 @@ jobs:
207219 - config-hdp3
208220 # TODO: config-apache-hive3
209221 timeout-minutes : 60
222+ env :
223+ SECRETS_PRESENT : ${{ secrets.SECRETS_PRESENT }}
210224 steps :
211225 - uses : actions/checkout@v3
212226 with :
@@ -315,6 +329,15 @@ jobs:
315329 path : |
316330 **/surefire-reports/TEST-*.xml
317331 retention-days : ${{ env.TEST_REPORT_RETENTION_DAYS }}
332+ - name : Upload heap dump
333+ uses : actions/upload-artifact@v3
334+ if : failure() && env.SECRETS_PRESENT == '' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
335+ with :
336+ name : heap dump ${{ github.job }} (${{ matrix.config }})
337+ if-no-files-found : ' ignore'
338+ path : |
339+ **/*.hprof
340+ retention-days : ${{ env.HEAP_DUMP_RETENTION_DAYS }}
318341 - name : Clean local Maven repo
319342 # Avoid creating a cache entry because this job doesn't download all dependencies
320343 if : steps.cache.outputs.cache-hit != 'true'
@@ -323,6 +346,8 @@ jobs:
323346 test-other-modules :
324347 runs-on : ubuntu-latest
325348 timeout-minutes : 60
349+ env :
350+ SECRETS_PRESENT : ${{ secrets.SECRETS_PRESENT }}
326351 steps :
327352 - uses : actions/checkout@v3
328353 with :
@@ -384,6 +409,15 @@ jobs:
384409 path : |
385410 **/surefire-reports/TEST-*.xml
386411 retention-days : ${{ env.TEST_REPORT_RETENTION_DAYS }}
412+ - name : Upload heap dump
413+ uses : actions/upload-artifact@v3
414+ if : failure() && env.SECRETS_PRESENT == '' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
415+ with :
416+ name : heap dump ${{ github.job }}
417+ if-no-files-found : ' ignore'
418+ path : |
419+ **/*.hprof
420+ retention-days : ${{ env.HEAP_DUMP_RETENTION_DAYS }}
387421 - name : Clean local Maven repo
388422 # Avoid creating a cache entry because this job doesn't download all dependencies
389423 if : steps.cache.outputs.cache-hit != 'true'
@@ -462,6 +496,8 @@ jobs:
462496 fail-fast : false
463497 matrix : ${{ fromJson(needs.build-test-matrix.outputs.matrix) }}
464498 timeout-minutes : 60
499+ env :
500+ SECRETS_PRESENT : ${{ secrets.SECRETS_PRESENT }}
465501 steps :
466502 - uses : actions/checkout@v3
467503 with :
@@ -574,6 +610,15 @@ jobs:
574610 path : |
575611 **/surefire-reports/TEST-*.xml
576612 retention-days : ${{ env.TEST_REPORT_RETENTION_DAYS }}
613+ - name : Upload heap dump
614+ uses : actions/upload-artifact@v3
615+ if : failure() && env.SECRETS_PRESENT == '' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
616+ with :
617+ name : heap dump ${{ github.job }} (${{ env.ARTIFACT_NAME }})
618+ if-no-files-found : ' ignore'
619+ path : |
620+ **/*.hprof
621+ retention-days : ${{ env.HEAP_DUMP_RETENTION_DAYS }}
577622 - name : Clean local Maven repo
578623 # Avoid creating a cache entry because this job doesn't download all dependencies
579624 if : steps.cache.outputs.cache-hit != 'true'
0 commit comments