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
7a066564
Unverified
Commit
7a066564
authored
Feb 03, 2021
by
Jonah Williams
Committed by
GitHub
Feb 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] add build system test for concurrent failures (#75251)
parent
4c545583
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
2 deletions
+40
-2
build_system_test.dart
...ls/test/general.shard/build_system/build_system_test.dart
+40
-2
No files found.
packages/flutter_tools/test/general.shard/build_system/build_system_test.dart
View file @
7a066564
...
...
@@ -4,6 +4,8 @@
// @dart = 2.8
import
'dart:async'
;
import
'package:file/memory.dart'
;
import
'package:file_testing/file_testing.dart'
;
import
'package:flutter_tools/src/artifacts.dart'
;
...
...
@@ -645,13 +647,49 @@ void main() {
expect
(
thirdResult
.
outputFiles
,
isEmpty
);
});
testWithoutContext
(
'Build completes all dependencies before failing'
,
()
async
{
final
MemoryFileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
BuildSystem
buildSystem
=
setUpBuildSystem
(
fileSystem
,
FakePlatform
(
operatingSystem:
'linux'
,
numberOfProcessors:
10
,
// Ensure the tool will process tasks concurrently.
));
final
Completer
<
void
>
startB
=
Completer
<
void
>();
final
Completer
<
void
>
startC
=
Completer
<
void
>();
final
Completer
<
void
>
finishB
=
Completer
<
void
>();
final
TestTarget
a
=
TestTarget
((
Environment
environment
)
{
throw
StateError
(
'Should not run'
);
})..
name
=
'A'
;
final
TestTarget
b
=
TestTarget
((
Environment
environment
)
async
{
startB
.
complete
();
await
finishB
.
future
;
throw
Exception
(
'1'
);
})..
name
=
'B'
;
final
TestTarget
c
=
TestTarget
((
Environment
environment
)
{
startC
.
complete
();
throw
Exception
(
'2'
);
})..
name
=
'C'
;
a
.
dependencies
.
addAll
(<
Target
>[
b
,
c
]);
final
Future
<
BuildResult
>
pendingResult
=
buildSystem
.
build
(
a
,
environment
);
await
startB
.
future
;
await
startC
.
future
;
finishB
.
complete
();
final
BuildResult
result
=
await
pendingResult
;
expect
(
result
.
success
,
false
);
expect
(
result
.
exceptions
.
keys
,
containsAll
(<
String
>[
'B'
,
'C'
]));
});
}
BuildSystem
setUpBuildSystem
(
FileSystem
fileSystem
)
{
BuildSystem
setUpBuildSystem
(
FileSystem
fileSystem
,
[
FakePlatform
platform
]
)
{
return
FlutterBuildSystem
(
fileSystem:
fileSystem
,
logger:
BufferLogger
.
test
(),
platform:
FakePlatform
(
operatingSystem:
'linux'
),
platform:
platform
??
FakePlatform
(
operatingSystem:
'linux'
),
);
}
...
...
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