Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
9a7e1870
Unverified
Commit
9a7e1870
authored
Feb 03, 2023
by
Christopher Fujino
Committed by
GitHub
Feb 03, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] fix Cannot delete file ENOENT from fuchsia_asset_builder (#119867)
* fix * add test
parent
be4c8c0e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
config.dart
packages/flutter_tools/lib/src/base/config.dart
+5
-1
config_test.dart
packages/flutter_tools/test/general.shard/config_test.dart
+20
-0
No files found.
packages/flutter_tools/lib/src/base/config.dart
View file @
9a7e1870
...
...
@@ -116,7 +116,11 @@ class Config {
if
(
managed
)
{
rethrow
;
}
else
{
try
{
_file
.
deleteSync
();
}
on
FileSystemException
{
// ignore
}
}
}
on
Exception
catch
(
err
)
{
_logger
...
...
packages/flutter_tools/test/general.shard/config_test.dart
View file @
9a7e1870
...
...
@@ -130,6 +130,26 @@ void main() {
expect
(
bufferLogger
.
errorText
,
contains
(
r'sudo chown -R $(whoami) /testfile'
));
});
testWithoutContext
(
'Config.createForTesting does not error when failing to delete a file'
,
()
{
final
BufferLogger
bufferLogger
=
BufferLogger
.
test
();
final
FileExceptionHandler
handler
=
FileExceptionHandler
();
final
MemoryFileSystem
fs
=
MemoryFileSystem
.
test
(
opHandle:
handler
.
opHandle
);
final
File
file
=
fs
.
file
(
'testfile'
)
// We write invalid JSON so that we test catching a `FormatException`
..
writeAsStringSync
(
'{"This is not valid JSON"'
);
handler
.
addError
(
file
,
FileSystemOp
.
delete
,
const
FileSystemException
(
"Cannot delete file, path = 'testfile' (OS Error: No such file or directory, errno = 2)"
,
),
);
// Should not throw a FileSystemException
Config
.
createForTesting
(
file
,
bufferLogger
);
});
testWithoutContext
(
'Config in home dir is used if it exists'
,
()
{
memoryFileSystem
.
file
(
'.flutter_example'
).
writeAsStringSync
(
'{"hello":"bar"}'
);
config
=
Config
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment