Skip to content

Commit a048b31

Browse files
committed
Drop coverage build intermediates before running the tests
docker system df shows buildPortableLibdatadogPhp leaves 5.97G of coverage-instrumented cargo intermediates in php-portable-libdatadog-php, which together with the pulled images puts the ~20G Docker host storage at 18G/93% before a single test runs. The tests then take it to 100%, and a full disk is what breaks RaspSqliTests: InnoDB reports "Error number 28 means 'No space left on device'". The build copies libdatadog_php.so out of the target directory and both the tests and the coverage report consume that copy, so the intermediates are dead weight afterwards. This volume is also not part of loadCaches/saveCaches, so nothing in a later job reuses them. Removing them frees ~6G before the tests start. Done in the job script rather than the Gradle task so local incremental rebuilds are unaffected.
1 parent e5b5baa commit a048b31

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

.gitlab/generate-appsec.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,19 @@
305305
TERM=dumb ./gradlew buildPortableLibdatadogPhp \
306306
--info -Pbuildscan --scan -PuseHelperRustCoverage
307307
report_docker_disk 'after buildPortableLibdatadogPhp'
308+
309+
# Coverage-instrumented artifacts are bulky: this leaves ~6G of cargo
310+
# intermediates in php-portable-libdatadog-php, over a quarter of the
311+
# ~20G available, and the tests then run the disk out. The build copies
312+
# libdatadog_php.so out of the target directory, and that copy is what
313+
# both the tests and the coverage report use, so the intermediates are
314+
# dead weight from here on. Unlike the cargo caches, this volume is not
315+
# part of loadCaches/saveCaches, so nothing later reuses them either.
316+
# Dropped here rather than in the Gradle task so local incremental
317+
# rebuilds keep working.
318+
docker run --rm -v php-portable-libdatadog-php:/vol alpine \
319+
rm -rf /vol/cargo-target
320+
report_docker_disk 'after dropping build intermediates'
308321
TERM=dumb ./gradlew test8.3-release-ssi test8.4-release-zts-ssi \
309322
--info -Pbuildscan --scan -PcheckCoreDumps -PuseHelperRustCoverage
310323
report_docker_disk 'after tests'

0 commit comments

Comments
 (0)