core(unit tests): cleanup unit tests
ENOSPC: no space left on device, write
We need to cleanup the results of CDK unit tests.
I get the above error when running npm test in a CDK Typescript project. Is there a manual command I can run to clean up CDK unit tests?
Hi @sumupitchayan,
Thanks for opening this issue! After reviewing the details, we found some other discussions that may be duplicates or closely related:
Potential Duplicate Issues
- aws/aws-cdk-cli#802: Both issues report the same underlying problem where CDK unit tests create numerous temporary directories that aren't cleaned up, eventually exhausting disk space. The current issue encounters "ENOSPC: no space left on device" error when running npm test, while this issue specifically identifies "cdk.out$hash" and "cdk-test-app-*" directories accumulating in $TMPDIR. Both require the same solution - proper cleanup of temporary test directories after test runs to prevent disk space exhaustion.
Related Issues
-
aws/aws-cdk#29368: This issue describes how CDK creates new temporary folders with each command execution, specifically focusing on the
cdk synthcommand creating directories that aren't cleaned up. While the current issue is specifically about unit test temporary directories, both share the same core problem of CDK operations creating persistent temporary files that accumulate and exhaust disk space over time. -
aws/aws-cdk#19016: This issue proposes adding "aws-cdk" to temporary file paths to make manual cleanup easier, which directly relates to the current issue's problem of temporary test files accumulation. While the current issue asks for a cleanup command for test artifacts, this related issue offers a partial solution by making temporary files more identifiable for manual cleanup, addressing the same underlying problem of CDK temporary file management.
This message was generated automatically to help connect related conversations and improve discoverability.
If you feel this issue brings new or distinct information, feel free to add a comment to keep it open. Otherwise, we'll close this issue in 7 days if we don't recieve a response to help keep discussions consolidated.
Please react with 👍 or 👎 to let us know if this response was helpful!
Thank you for helping improve CDK! 🙌
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.