From ad441e49e6dfe3e58fe3e0dcebebe985134becb3 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Wed, 2 Apr 2025 16:16:08 -0700 Subject: [PATCH 1/3] Update vm_posix_file_system.dart --- pkgs/io_file/lib/src/vm_posix_file_system.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/io_file/lib/src/vm_posix_file_system.dart b/pkgs/io_file/lib/src/vm_posix_file_system.dart index a56bced5..4c54c882 100644 --- a/pkgs/io_file/lib/src/vm_posix_file_system.dart +++ b/pkgs/io_file/lib/src/vm_posix_file_system.dart @@ -38,9 +38,14 @@ Exception _getError(int errno, String message, String path) { /// Return the given function until the result is not `EINTR`. int _tempFailureRetry(int Function() f) { int result; + var errno = 0; do { result = f(); - } while (result == -1 && stdlibc.errno == stdlibc.EINTR); + errno = stdlibc.errno; + if (errno != 0) { + print('unexpected errno: $errno'); + } + } while (result == -1 && errno == stdlibc.EINTR); return result; } From 0cef005275a90c65a5eb292a5df6fc2315e17706 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Wed, 2 Apr 2025 16:20:46 -0700 Subject: [PATCH 2/3] Update io_file.yml --- .github/workflows/io_file.yml | 61 +++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/.github/workflows/io_file.yml b/.github/workflows/io_file.yml index 767905f6..dfc5af09 100644 --- a/.github/workflows/io_file.yml +++ b/.github/workflows/io_file.yml @@ -22,33 +22,30 @@ defaults: working-directory: pkgs/io_file jobs: - analyze_and_format: + + profile-vm-test1: + # Ensure that the tests pass when run under the profiler (which sends + # SIG_PROF on Linux). runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c with: sdk: stable - - run: dart pub get - - run: dart analyze --fatal-infos - - run: dart format --output=none --set-exit-if-changed . + - run: dart --profiler --profile_period=50 test --test-randomize-ordering-seed=random --platform vm - desktop-vm-test: - strategy: - fail-fast: false - matrix: - sdk: [stable, dev] - os: [ubuntu-latest, windows-latest, macos-latest] - runs-on: ${{ matrix.os }} + profile-vm-test2: + # Ensure that the tests pass when run under the profiler (which sends + # SIG_PROF on Linux). + runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c with: - sdk: ${{ matrix.sdk }} - - - run: dart test --test-randomize-ordering-seed=random --platform vm + sdk: stable + - run: dart --profiler --profile_period=50 test --test-randomize-ordering-seed=random --platform vm - profile-vm-test: + profile-vm-test3: # Ensure that the tests pass when run under the profiler (which sends # SIG_PROF on Linux). runs-on: ubuntu-latest @@ -59,28 +56,36 @@ jobs: sdk: stable - run: dart --profiler --profile_period=50 test --test-randomize-ordering-seed=random --platform vm - desktop-vm-benchmark: - strategy: - fail-fast: false - matrix: - sdk: [stable] - os: [ubuntu-latest, windows-latest, macos-latest] - runs-on: ${{ matrix.os }} + profile-vm-test4: + # Ensure that the tests pass when run under the profiler (which sends + # SIG_PROF on Linux). + runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c with: - sdk: ${{ matrix.sdk }} - - run: dart pub get - - name: 🪑 Run benchmarks - run: dart run benchmarks/read_as_bytes.dart + sdk: stable + - run: dart --profiler --profile_period=50 test --test-randomize-ordering-seed=random --platform vm - web-test: + profile-vm-test5: + # Ensure that the tests pass when run under the profiler (which sends + # SIG_PROF on Linux). runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c with: sdk: stable + - run: dart --profiler --profile_period=50 test --test-randomize-ordering-seed=random --platform vm - - run: dart test --test-randomize-ordering-seed=random --platform chrome + profile-vm-test6: + # Ensure that the tests pass when run under the profiler (which sends + # SIG_PROF on Linux). + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c + with: + sdk: stable + - run: dart --profiler --profile_period=50 test --test-randomize-ordering-seed=random --platform vm + \ No newline at end of file From b32180e6afabaf07a3ae611bdae8ce3006f69f2a Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Wed, 2 Apr 2025 16:24:17 -0700 Subject: [PATCH 3/3] Update vm_posix_file_system.dart --- pkgs/io_file/lib/src/vm_posix_file_system.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/io_file/lib/src/vm_posix_file_system.dart b/pkgs/io_file/lib/src/vm_posix_file_system.dart index 4c54c882..f5845c2c 100644 --- a/pkgs/io_file/lib/src/vm_posix_file_system.dart +++ b/pkgs/io_file/lib/src/vm_posix_file_system.dart @@ -42,7 +42,7 @@ int _tempFailureRetry(int Function() f) { do { result = f(); errno = stdlibc.errno; - if (errno != 0) { + if (result == -1 && errno != 0) { print('unexpected errno: $errno'); } } while (result == -1 && errno == stdlibc.EINTR);