flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
163.13k stars 26.84k forks source link

In devicelab, periodically delete Xcode AppInstallationBinaryDeltas #148814

Open jmagman opened 1 month ago

jmagman commented 1 month ago

On the devicelab the app installation deltas directory seems to grow and grow, eventually leading to low disk space:

~/Library/Containers/com.apple.CoreDevice.CoreDeviceService/Data/Library/Caches/AppInstallationBinaryDeltas
1.9G io.flutter.platformview.PlatformViewUITests.xctrunner
3.7G com.yourcompany.flutterView
4.2G io.flutter.examples.fullPlatformView
5.8G io.flutter.demo.gallery
8.1G com.yourcompany.microbenchmarks
8.2G com.example.platformChannelsBenchmarks
11M dev.flutter.infra-dialogUITests.xctrunner
12G com.yourcompany.platformViewsLayout
15G com.yourcompany.platforminteraction
15G io.flutter.externalUi
16G com.example.PlatformChannel
16G com.example.PlatformChannelSwift
16G com.example.spellCheck
16G com.yourcompany.flavors.paid
17G com.example.channels
17G com.example.wideGamutTest
19G io.flutter.platformview.platformviewTests
20G com.yourcompany.complexLayout
22G com.example.packageWithNativeAssets
25G io.flutter.examples.gallery
38G com.example.newGallery
110G io.flutter.e2e
242G com.example.macrobenchmarks

https://github.com/flutter/flutter/issues/148684#issuecomment-2123558467

Set up something (user agent?) in the devicelab to periodically remove everything in this directory. The app deltas in this directory keep subsequent installations incremental, so we probably shouldn't delete it on every run, or it will slow down the tests and unnecessarily increase the bits we're writing to the device.

christopherfujino commented 1 month ago

I was thinking we use the device doctor. Maybe the same time we check for missing symbols, we also check for free disk usage, and if it's over some threshold we nuke the binary deltas?

What's happening now is that swarming has its own threshold (80% usage, I think?), and once exceeded the bot gets auto-quarantined. We could set our threshold slightly lower.