Skip to content

[path_provider] Frequent flake in macos_platform_tests #187563

Description

@stuartmorgan-g

We're suddenly getting very persistent flake in the integration tests for path_provider on macOS:

00:00 +0: getTemporaryDirectory
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following PathNotFoundException was thrown running a test:
Cannot open file, path =
'/Users/chrome-bot/Library/Caches/dev.flutter.plugins.pathProviderExample/temporaryDirectory' (OS
Error: No such file or directory, errno = 2)

When the exception was thrown, this was the stack:
#0      _File.throwIfError (dart:io/file_impl.dart:779:7)
#1      _File.openSync (dart:io/file_impl.dart:572:5)
#2      _File.writeAsBytesSync (dart:io/file_impl.dart:744:31)
#3      _File.writeAsStringSync (dart:io/file_impl.dart:772:5)
#4      _verifySampleFile (file:///Volumes/Work/s/w/ir/x/w/packages/packages/path_provider/path_provider/example/integration_test/path_provider_test.dart:124:8)
#5      main.<anonymous closure> (file:///Volumes/Work/s/w/ir/x/w/packages/packages/path_provider/path_provider/example/integration_test/path_provider_test.dart:15:5)
<asynchronous suspension>
#6      testWidgets.<anonymous closure>.<anonymous closure> (package:flutter_test/src/widget_tester.dart:192:15)
<asynchronous suspension>
#7      TestWidgetsFlutterBinding._runTestBody (package:flutter_test/src/binding.dart:1953:5)
<asynchronous suspension>
<asynchronous suspension>
(elided one frame from package:stack_trace)

The test description was:
  getTemporaryDirectory
════════════════════════════════════════════════════════════════════════════════════════════════════
00:00 +0 -1: getTemporaryDirectory [E]
  Test failed. See exception logs above.
  The test description was: getTemporaryDirectory

I don't think anything changed on our side, so it may be a change on the bots (e.g., a macOS update with different behavior). It looks like this may be a latent issue in the test, as it seems to be assuming the directory will already exist even though we don't guarantee that. What's odd though is that it looks like path_provider_darwin has the same structure still, and isn't failing.

Still, we should make the test create the directory if necessary, and see if that resolves it.

Metadata

Metadata

Labels

P1High-priority issues at the top of the work listp: path_providerPlugin that provides resolved paths to some platform directoriespackageflutter/packages repository. See also p: labels.platform-macosBuilding on or for macOS specifically

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions