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
114ba8cc
Unverified
Commit
114ba8cc
authored
Feb 24, 2021
by
Jonah Williams
Committed by
GitHub
Feb 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] add unit test for error 32 in cache deletion (#76714)
parent
109e0bb9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
artifact_updater_test.dart
...utter_tools/test/general.shard/artifact_updater_test.dart
+32
-0
No files found.
packages/flutter_tools/test/general.shard/artifact_updater_test.dart
View file @
114ba8cc
...
...
@@ -438,6 +438,38 @@ void main() {
expect
(
fileSystem
.
file
(
'a/b/c/d'
),
isNot
(
exists
));
expect
(
logger
.
errorText
,
isEmpty
);
});
testWithoutContext
(
'ArtifactUpdater will tool exit if deleting the existing artifacts fails with 32 on windows'
,
()
async
{
const
int
kSharingViolation
=
32
;
final
FileExceptionHandler
handler
=
FileExceptionHandler
();
final
FakeOperatingSystemUtils
operatingSystemUtils
=
FakeOperatingSystemUtils
();
final
MemoryFileSystem
fileSystem
=
MemoryFileSystem
.
test
(
opHandle:
handler
.
opHandle
);
final
BufferLogger
logger
=
BufferLogger
.
test
();
final
ArtifactUpdater
artifactUpdater
=
ArtifactUpdater
(
fileSystem:
fileSystem
,
logger:
logger
,
operatingSystemUtils:
operatingSystemUtils
,
platform:
FakePlatform
(
operatingSystem:
'windows'
),
httpClient:
FakeHttpClient
.
any
(),
tempStorage:
fileSystem
.
currentDirectory
.
childDirectory
(
'temp'
)
..
createSync
(),
);
final
Directory
errorDirectory
=
fileSystem
.
currentDirectory
.
childDirectory
(
'out'
)
.
childDirectory
(
'test'
)
..
createSync
(
recursive:
true
);
handler
.
addError
(
errorDirectory
,
FileSystemOp
.
delete
,
const
FileSystemException
(
''
,
''
,
OSError
(
''
,
kSharingViolation
)));
await
expectLater
(()
async
=>
await
artifactUpdater
.
downloadZippedTarball
(
'test message'
,
Uri
.
parse
(
'http://test.zip'
),
fileSystem
.
currentDirectory
.
childDirectory
(
'out'
),
),
throwsToolExit
(
message:
'Failed to delete /out/test because the local file/directory is in use by another process'
));
expect
(
fileSystem
.
file
(
'out/test'
),
isNot
(
exists
));
});
}
class
FakeOperatingSystemUtils
extends
Fake
implements
OperatingSystemUtils
{
...
...
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