Skip to content

Update vm_posix_file_system.dart #209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 33 additions & 28 deletions .github/workflows/io_file.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

7 changes: 6 additions & 1 deletion pkgs/io_file/lib/src/vm_posix_file_system.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down