Skip to content

fix: System.IO.IOException: No space left on device on linux-musl x64 - #4743

Merged
jamescrosswell merged 10 commits into
mainfrom
disk-space-musl
Dec 10, 2025
Merged

jamescrosswell merged 10 commits into
mainfrom
disk-space-musl

Conversation

@jamescrosswell

@jamescrosswell jamescrosswell commented Nov 17, 2025 •

Copy link
Copy Markdown
Collaborator

Resolves #4788

The containers are pretty lean and I didn't see any opportunity to trim these down further. This PR cleans up a few temporary files before the tests are run (as that's when the jobs were failing). It doesn't work miracles but probably saves enough space to keep everything running a little longer:

Run echo "Disk usage before cleanup:"
Disk usage before cleanup:
Filesystem                Size      Used Available Use% Mounted on
overlay                  71.6G     70.0G      1.6G  98% /
...
Clearing NuGet HTTP cache: /github/home/.local/share/NuGet/http-cache
Local resources cleared.
Disk usage after cleanup:
Filesystem                Size      Used Available Use% Mounted on
overlay                  71.6G     69.1G      2.5G  96% /
...

See also

#skip-changelog

@jamescrosswell jamescrosswell changed the title Try reintroducing free disk space task for containers fix: System.IO.IOException: No space left on device on linux-musl x64 Nov 17, 2025
@codecov

codecov Bot commented Nov 17, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.91%. Comparing base (64b0df9) to head (7970193).
⚠️ Report is 45 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4743      +/-   ##
==========================================
+ Coverage   73.66%   73.91%   +0.25%     
==========================================
  Files         476      485       +9     
  Lines       17442    17682     +240     
  Branches     3453     3494      +41     
==========================================
+ Hits        12848    13070     +222     
- Misses       3746     3755       +9     
- Partials      848      857       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jamescrosswell

jamescrosswell commented Nov 17, 2025 •

Copy link
Copy Markdown
Collaborator Author

The Alpine container that we were using was the nightly build. Up until recently, that had .net 10 rc2 on it. Recently this must have been updated to include the GA release instead.

Our workflows install the version of .net that we have pinned and up until recently that was rc2... so when the Alpine container bumped to GA, we ended up with two versions of .net on there: rc2 and ga. After merging #4723, the problem seems to have been resolved.

edit: spoke too soon... this has started breaking again.

@Flash0ver
Flash0ver deleted the disk-space-musl branch November 17, 2025 10:51
@jamescrosswell
jamescrosswell restored the disk-space-musl branch December 8, 2025 23:40
@jamescrosswell jamescrosswell reopened this Dec 8, 2025
@jamescrosswell
jamescrosswell marked this pull request as ready for review December 9, 2025 20:39
build.binlog
if-no-files-found: ignore

- name: Free disk space before tests

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Cleanup action runs inside container, not on runner

The condition if: ${{ !matrix.container }} was removed from the "Remove unused applications" step. This causes the freediskspace action to run inside Alpine containers rather than being skipped. Since the PR aims to free space on the runner (not the container), running cleanup inside the container won't achieve the intended goal. Additionally, the freediskspace action uses Ubuntu-specific commands (apt-get) that don't exist in Alpine Linux (which uses apk). The original condition correctly prevented this action from running when a container is specified.

Fix in Cursor Fix in Web

Comment on lines +50 to +56
# Clean up apt packages
sudo apt-get remove -y '^mysql-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^mysql-.*' --fix-missing] failed to complete successfully. Proceeding..."
sudo apt-get remove -y '^postgresql-.*' --fix-missing || echo "::warning::PostgreSQL removal failed"
sudo apt-get remove -y '^mongodb-.*' --fix-missing || echo "::warning::MongoDB removal failed"
sudo apt-get autoremove -y || echo "::warning::The command [sudo apt-get autoremove -y] failed to complete successfully. Proceeding..."
sudo apt-get clean || echo "::warning::The command [sudo apt-get clean] failed to complete successfully. Proceeding..."
df -h /dev/root

@Flash0ver Flash0ver Dec 10, 2025 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: We get these warnings during the build:

# .NET (linux-musl-x64)
The command [sudo apt-get clean] failed to complete successfully. Proceeding...
# .NET (linux-musl-x64)
The command [sudo apt-get autoremove -y] failed to complete successfully. Proceeding...
# .NET (linux-musl-x64)
MongoDB removal failed
# .NET (linux-musl-x64)
PostgreSQL removal failed
# .NET (linux-musl-x64)
The command [sudo apt-get remove -y '^mysql-.*' --fix-missing] failed to complete successfully. Proceeding...

# .NET (linux-musl-arm64)
The command [sudo apt-get clean] failed to complete successfully. Proceeding...
# .NET (linux-musl-arm64)
The command [sudo apt-get autoremove -y] failed to complete successfully. Proceeding...
# .NET (linux-musl-arm64)
MongoDB removal failed
# .NET (linux-musl-arm64)
PostgreSQL removal failed
# .NET (linux-musl-arm64)
The command [sudo apt-get remove -y '^mysql-.*' --fix-missing] failed to complete successfully. Proceeding...

Can we if-Condition to only run on supported platforms / not run on non-supported platforms (linux-musl-x64 and linux-musl-arm64)?
Maybe by splitting it into a step that does sudo rm, and another step that does the sudo apt-get (but not for Alpine Linux)?

Maybe something like:

- name: Remove unused packages
  if: ${{ !contains(matrix.container.image, 'alpine') }}
  run: |
    # Clean up apt packages
    sudo apt-get ...
    ...

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's pretty much what we had before:
image

I'll put that bit back since the freediskspace action is ineffective on the containers.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I meant to just execute thesudo apt-get conditionally, since they produce the ::warning:: messages.
But keep the sudo rm on all Linux runners, since they seem to work just fine.

@jamescrosswell jamescrosswell Dec 10, 2025 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah OK, we can tidy up the non-container runners in another PR if need be 👍🏻

@jamescrosswell
jamescrosswell merged commit b186caa into main Dec 10, 2025
@jamescrosswell
jamescrosswell deleted the disk-space-musl branch December 10, 2025 19:48
ric-oliv added a commit that referenced this pull request Oct 27, 2026
#4789 turned them off on linux-musl-x64 while they hung there without
an error, tracked in #4788. #4743 fixed the disk space problem behind
it, and #4788 was closed in December 2025, but the guard stayed. The
leg finishes in about 9 minutes without them, and the same tests take
about 6 on linux-musl-arm64, so the leg still ends well before the
slowest check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
ric-oliv added a commit that referenced this pull request Oct 27, 2026
* ci: build the app samples in their own job

The app samples only check that they compile, but their Release builds
trim, AOT-compile and package each app. In the macOS leg that's about
13.7 of the Build step's 28.3 task-minutes, and it's the whole tail of
the step once the Cocoa SDK comes from the cache. On Windows, the MAUI
sample's Android build is the last thing the Build step finishes.

The Android, iOS, Mac Catalyst, macOS and MAUI samples now build in a
separate job that starts with the .NET legs: all of them on macOS, the
Android and MAUI samples on Linux, and the MAUI sample on Windows,
which is the only build of its Windows target. The legs' solution
filters no longer include them, and generated filters list them. The
samples job's Cocoa SDK steps match the macOS leg's.

So that msbuild.exe still builds an Android and a Windows app, the
MSBuild job builds the MAUI sample after the solution filter. That took
180 to 211 seconds on three runs, and the job still ended about 10
minutes before the slowest check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci: run the integration tests in their own jobs

The build legs built, ran the unit tests, and then ran the integration
tests, one step after another. On macOS the MAUI cases in cli.Tests.ps1
took 8 to 10 of the leg's 13 to 15 integration test minutes, building
three Release apps for Android, iOS and Mac Catalyst, and the Windows
legs spent 12 to 16 minutes in the integration tests.

The MAUI cases move to cli-maui.Tests.ps1, unchanged except that
SKIP_MAUI_TESTS also skips them. A new integration-test job runs next
to the legs: on macOS it runs the MAUI cases, which the macOS leg now
skips, and on linux-x64, win-x64 and win-arm64 it runs every
integration test file, which those legs now skip. Each entry builds
and packs only the packages its tests use, from two generated solution
filters: Sentry-CI-IntegrationTest-macOS.slnf, which adds the Cocoa
bindings, and Sentry-CI-IntegrationTest.slnf. It packs with --no-build
like the legs, because packing Sentry.Maui while building it on macOS
fails with NU5026.

These packages aren't the ones the macOS leg publishes, but
CI_PUBLISHING_BUILD only adds the other desktop platforms' native
libraries and sentry-cli binaries, which these tests don't use. On
release branches the macOS leg runs the MAUI cases too, against the
packages it uploads for craft, so the packages we publish are still
the ones tested. The integration-test job runs them there as well,
which keeps the jobs the same on every branch.

On three runs with the other CI changes, the win-x64, linux-x64 and
win-arm64 legs took 15.0, 11.2 and 17.9 minutes, and their integration
jobs 18.5, 12.7 and 22.1. Before, the win-arm64 leg took 31 and was the
slowest job. The new jobs passed the same 69 tests and skipped the same
35 as the legs did before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci: run the integration tests on linux-musl-x64 again

#4789 turned them off on linux-musl-x64 while they hung there without
an error, tracked in #4788. #4743 fixed the disk space problem behind
it, and #4788 was closed in December 2025, but the guard stayed. The
leg finishes in about 9 minutes without them, and the same tests take
about 6 on linux-musl-arm64, so the leg still ends well before the
slowest check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integration tests are flaky on linux-musl-x64 runners

2 participants