Skip to content

[path_provider] Create temp dir in tests if needed#11841

Merged
auto-submit[bot] merged 1 commit into
flutter:mainfrom
stuartmorgan-g:path-provider-macos-missing-dir-in-test
Jun 4, 2026
Merged

[path_provider] Create temp dir in tests if needed#11841
auto-submit[bot] merged 1 commit into
flutter:mainfrom
stuartmorgan-g:path-provider-macos-missing-dir-in-test

Conversation

@stuartmorgan-g

@stuartmorgan-g stuartmorgan-g commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

The integration test step that validates that a file can be created in the returned directory assumes that the directory already exists, which isn't guaranteed to be true for getTemporaryDirectory, and this is now failing on macOS in CI. To avoid the failure, create the directory if necessary for the tests that run on macOS.

Hopefully fixes flutter/flutter#187563

Pre-Review Checklist

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2

The integration test step that validates that a file can be created in
the returned directory assumes that the directory already exists, which
isn't guaranteed to be true for getTemporaryDirectory, and this is now
failing on macOS in CI. To avoid the failure, create the directory if
necessary for the tests that run on macOS.

Fixes flutter/flutter#187563

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request updates the integration tests in both path_provider and path_provider_foundation to handle cases where the temporary directory does not exist. It introduces an optional createDirectory parameter to the _verifySampleFile helper function to recursively create the directory when needed, and applies this to the temporary directory tests. There are no review comments, so no feedback is provided.

@stuartmorgan-g

Copy link
Copy Markdown
Collaborator Author

The fact that it passed tests is promising, but I'm not sure if it's bot-config-specific.

The real test will be seeing if #11830 and #11823 get unstuck once this lands.

@justinmc justinmc left a comment

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.

LGTM 👍

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 4, 2026
@auto-submit auto-submit Bot merged commit 2e006b2 into flutter:main Jun 4, 2026
87 checks passed
tamirenkhbayar3-cmd pushed a commit to tamirenkhbayar3-cmd/flutter that referenced this pull request Jun 5, 2026
…r#187612)

flutter/packages@03352b5...61bdbb4

2026-06-04 stuartmorgan@google.com [tool] Use `flutter` for pub commands
when examples use Flutter (flutter/packages#11830)
2026-06-04 stuartmorgan@google.com Sync analysis_options.yaml with
flutter/flutter (flutter/packages#11823)
2026-06-04 stuartmorgan@google.com [path_provider] Create temp dir in
tests if needed (flutter/packages#11841)
2026-06-04 jeff.ward@datadoghq.com [webview] Add new method for cross
plugin webview access (flutter/packages#11714)
2026-06-04 47866232+chunhtai@users.noreply.github.com [ci] Renames the
override post-release label for batch release (flutter/packages#11835)

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 flutter-ecosystem@google.com 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
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
The integration test step that validates that a file can be created in the returned directory assumes that the directory already exists, which isn't guaranteed to be true for getTemporaryDirectory, and this is now failing on macOS in CI. To avoid the failure, create the directory if necessary for the tests that run on macOS.

Hopefully fixes flutter/flutter#187563

## Pre-Review Checklist

[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
via-guy pushed a commit to via-guy/flutter that referenced this pull request Jun 26, 2026
…r#187612)

flutter/packages@03352b5...61bdbb4

2026-06-04 stuartmorgan@google.com [tool] Use `flutter` for pub commands
when examples use Flutter (flutter/packages#11830)
2026-06-04 stuartmorgan@google.com Sync analysis_options.yaml with
flutter/flutter (flutter/packages#11823)
2026-06-04 stuartmorgan@google.com [path_provider] Create temp dir in
tests if needed (flutter/packages#11841)
2026-06-04 jeff.ward@datadoghq.com [webview] Add new method for cross
plugin webview access (flutter/packages#11714)
2026-06-04 47866232+chunhtai@users.noreply.github.com [ci] Renames the
override post-release label for batch release (flutter/packages#11835)

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 flutter-ecosystem@google.com 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 CICD Run CI/CD p: path_provider platform-ios platform-macos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[path_provider] Frequent flake in macos_platform_tests

2 participants