Skip to content

Conversation

gmackall
Copy link
Member

@gmackall gmackall commented Dec 8, 2023

Fixes the flaky path provider test.

Directories.listSync will sometimes not return the files in the directory (as discussed in flutter/flutter#139378), but the files are there and (after letting it loop for quite a while and comparing to current flake) they always appear in the output of Process.runSync('ls', ...).

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@gmackall gmackall changed the title [path_provider] [path_provider] De-flake getExternalStorageDirectories test Dec 8, 2023
@stuartmorgan-g
Copy link
Collaborator

Directories.listSync will sometimes not return the files in the directory (as discussed in flutter/flutter#139378), but the files are there and (after letting it loop for quite a while and comparing to current flake) they always appear in the output of Process.runSync('ls', ...).

That's super weird. Is there a Dart issue filed that we can reference in a comment?

@gmackall
Copy link
Member Author

gmackall commented Dec 8, 2023

Directories.listSync will sometimes not return the files in the directory (as discussed in flutter/flutter#139378), but the files are there and (after letting it loop for quite a while and comparing to current flake) they always appear in the output of Process.runSync('ls', ...).

That's super weird. Is there a Dart issue filed that we can reference in a comment?

Filed dart-lang/sdk#54287 and added a comment

file.writeAsStringSync('Hello world!');
expect(file.readAsStringSync(), 'Hello world!');
expect(directory.listSync(), isNotEmpty);
// This check intentionally avoids using Directory.listSync due to
Copy link
Collaborator

Choose a reason for hiding this comment

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

For the app-facing package we should probably make this codepath Android-only, and have other platforms keep using listSync.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed!

Copy link
Collaborator

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

LGTM once autoformat is happy.

@gmackall
Copy link
Member Author

LGTM once autoformat is happy.

I don't know why I assumed that was the changelog/version checker complaining 🤦. Thanks for taking another look, I'll fix that and then land

@gmackall
Copy link
Member Author

Tree is blocked on two failures, one of which is this test failing (#5619 only disabled the test in path_provider_android but this same test is also run by the app-facing package on android).

Should this land on red to fix, or does the other blocker need to be resolved first?

@gmackall gmackall added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 13, 2023
@auto-submit auto-submit bot merged commit 2133991 into flutter:main Dec 13, 2023
@gmackall gmackall deleted the debugging_path_provider_test branch December 13, 2023 20:33
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Dec 14, 2023
flutter/packages@b5958e2...1151191

2023-12-14 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 2.22.8 to 3.22.11 (flutter/packages#5674)
2023-12-13 [email protected] [ci][web] Ignore always_specify_types for JSArray. (flutter/packages#5669)
2023-12-13 [email protected] [tool] Add support for `.java`, `.gradle`, `.sh`, and `.m` filesâ�¦ (flutter/packages#5567)
2023-12-13 [email protected] [google_sign_in] Update (web) example app. (flutter/packages#5634)
2023-12-13 [email protected] [path_provider] De-flake getExternalStorageDirectories test (flutter/packages#5628)
2023-12-13 [email protected] [google_sign_in_web] Stop relying on framework internals. (flutter/packages#5660)
2023-12-13 [email protected] [Android] Bump Gradle version to 7.6.3 (flutter/packages#5522)
2023-12-13 [email protected] [google_sign_in] Adopt code excerpts in README (flutter/packages#5521)
2023-12-13 [email protected] [css_colors] Adopt code excerpts in README (flutter/packages#5478)
2023-12-13 [email protected] [webview_flutter] Support for handling basic authentication requests (Android) (flutter/packages#5454)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App p: path_provider platform-android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants