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 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..f5845c2c 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 (result == -1 && errno != 0) { + print('unexpected errno: $errno'); + } + } while (result == -1 && errno == stdlibc.EINTR); return result; }