You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dart test temporary disk usage grows linearly with test file count #2710
During dart test, the dart_test.kernel.* temporary directory retains a complete .dill file for every test file. Temporary disk usage grows approximately linearly with the number of test files and is released only when the full command exits.
import'package:analyzer/dart/analysis/utilities.dart';
import'package:test/test.dart';
voidmain() {
test('parses a Dart library', () {
final result =parseString(
content:'class Example { final int value = 1; }',
);
expect(result.errors, isEmpty);
});
}
dart pub get
mkdir -p .tmp
TMPDIR="$PWD/.tmp" dart test
While the hold test is running, inspect the directory from another terminal:
find .tmp -name 'test.dart_*.dill'| wc -l
du -sh .tmp/dart_test.kernel.*
Expected behavior
Temporary disk usage should remain bounded as test files finish.
Actual behavior
The reproduction retains 41 .dill files and uses approximately 950 MB. Each ordinary test file adds approximately 23 MB, although the 40 copied test files contain only about 11 KB of source in total.
In a larger run with 274 test files, the temporary directory exceeded 10 GB and exhausted the available disk space before the command completed.
--verbose output
When the disk filled, the remaining test files failed to load with:
FileSystemException: writeFrom failed, path = '.../dart_test.kernel.<suffix>/output.dill' (OS Error: No space left on device, errno = 28)
Every compile copies the frontend server output to a new test.dart_N.dill (test_compiler.dart:159) and nothing deletes them until dispose(). On 1.31.2 I get 11 dills and 242 MiB from 11 test files.
A suite is finished once cleanupCallbacks runs in platform.dart, but _dillToCache points at the largest dill and is only copied out in dispose(), so just that one has to survive. Do you want a release method on TestCompiler driven from those callbacks, or a different temp layout?
Activity
Yusufihsangorgel commentedon Aug 12, 2026
Every compile copies the frontend server output to a new
test.dart_N.dill(test_compiler.dart:159) and nothing deletes them untildispose(). On 1.31.2 I get 11 dills and 242 MiB from 11 test files.A suite is finished once
cleanupCallbacksruns inplatform.dart, but_dillToCachepoints at the largest dill and is only copied out indispose(), so just that one has to survive. Do you want a release method onTestCompilerdriven from those callbacks, or a different temp layout?Delete compilation artifacts once they are no longer needed (dart-lan…